summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-05-31 11:40:47 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-05-31 11:40:47 +0200
commit83dff584787f65690731e609382587475a8a2ba7 (patch)
tree9ca340ceb06f456e02bc37abcd31364017de5392 /plugins
parentfed2592da92e05867baed93d7cc8c3b34c272e59 (diff)
parent218751d661d80fe18cef441d4a3abbd553ce7f40 (diff)
Merge pull request #7 from Lithopsian/master
Preserve file permissions from the original file
Diffstat (limited to 'plugins')
-rw-r--r--plugins/vorbis/vcedit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/vorbis/vcedit.c b/plugins/vorbis/vcedit.c
index 5709f89c..2f30aeb6 100644
--- a/plugins/vorbis/vcedit.c
+++ b/plugins/vorbis/vcedit.c
@@ -33,6 +33,7 @@
#include <limits.h>
#include <unistd.h>
#include <stdbool.h>
+#include <sys/stat.h>
#include <ogg/ogg.h>
#include <deadbeef.h>
#include "vcedit.h"
@@ -220,6 +221,9 @@ off_t vcedit_write_metadata(DB_FILE *in, const char *fname, int link, const char
*lasterror = "file not opened for reading.";
goto cleanup;
}
+ struct stat stat_struct;
+ if (!stat(fname, &stat_struct))
+ chmod(outname, stat_struct.st_mode);
/* Copy through pages until we reach the right info header */
int codec_serial = 0;