From: Date: Sun, 8 Dec 2013 23:45:49 +0000 (-0800) Subject: set mode on output file, and don't clobber existing X-Git-Url: https://diplodocus.org/git/flac-archive/commitdiff_plain/e1747e1bac12e3939a3c8707d0482131a48d8845?hp=ce3567b100dd73baa1356444203e458366914d71 set mode on output file, and don't clobber existing --- diff --git a/apic-read.cc b/apic-read.cc index ad07b3d..d03287f 100644 --- a/apic-read.cc +++ b/apic-read.cc @@ -41,7 +41,7 @@ main(int argc, char **argv) } AttachedPictureFrame *pic_frame = (AttachedPictureFrame *)frame; TagLib::ByteVector data = pic_frame->picture(); - int fd = open(argv[2], O_CREAT | O_WRONLY); + int fd = open(argv[2], O_CREAT | O_EXCL | O_WRONLY, 0644); if (fd < 0) { perror("open"); return 2;