From ebb207dc5a922631bd9d9177f19538129d7fcefa Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 26 Apr 1999 12:47:33 +0000 Subject: [PATCH] (open_maybe_create): Don't pass 0666 to open; it's not needed and isn't guaranteed to be portable. --- src/touch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/touch.c b/src/touch.c index 7cf1c1b3f4..073e42cf2b 100644 --- a/src/touch.c +++ b/src/touch.c @@ -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; -- 2.47.3