(open_maybe_create): Don't pass 0666 to open; it's not needed and isn't
authorJim Meyering <jim@meyering.net>
Mon, 26 Apr 1999 12:47:33 +0000 (12:47 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 26 Apr 1999 12:47:33 +0000 (12:47 +0000)
guaranteed to be portable.

src/touch.c

index 7cf1c1b..073e42c 100644 (file)
@@ -115,7 +115,8 @@ open_maybe_create (const char *file, int *file_created)
   while (1)
     {
       /* First, see if we can create a new FILE.  */
-      fd = open (file, O_WRONLY | O_CREAT | O_EXCL, 0666);
+      fd = open (file, O_WRONLY | O_CREAT | O_EXCL,
+                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
       if (fd != -1)
        *file_created = 1;