X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fmake-file.c;h=e4c9234044a687a078d198c2ec85f5385cd4f7dd;hb=9a04fda196e392d456f034e1fc2ad744a20d22b4;hp=f8719dc67223d6cd1f44be998f49632ac5bdf0ce;hpb=707848060e414fe93458834446dd7cdbf800667f;p=pspp-builds.git diff --git a/src/data/make-file.c b/src/data/make-file.c index f8719dc6..e4c92340 100644 --- a/src/data/make-file.c +++ b/src/data/make-file.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -176,7 +177,7 @@ replace_file_start (const char *file_name, const char *mode, { /* Generate unique temporary file name. */ rf->tmp_name = xasprintf ("%s.tmpXXXXXX", file_name); - if (gen_tempname (rf->tmp_name, GT_NOCREATE) < 0) + if (gen_tempname (rf->tmp_name, 0, 0600, GT_NOCREATE) < 0) { msg (ME, _("Creating temporary file to replace %s: %s."), rf->file_name, strerror (errno)); @@ -184,7 +185,7 @@ replace_file_start (const char *file_name, const char *mode, } /* Create file by that name. */ - fd = open (rf->tmp_name, O_WRONLY | O_CREAT | O_EXCL, permissions); + fd = open (rf->tmp_name, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, permissions); if (fd >= 0) break; if (errno != EEXIST)