summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-04-26 12:47:33 +0000
committerJim Meyering <jim@meyering.net>1999-04-26 12:47:33 +0000
commitebb207dc5a922631bd9d9177f19538129d7fcefa (patch)
tree19f95882ed9c0b9c057facf3caa38463f5f229e3 /src
parentd0eeabbc32898e5640941b36b92e5060ebf03dd0 (diff)
downloadcoreutils-ebb207dc5a922631bd9d9177f19538129d7fcefa.tar.xz
(open_maybe_create): Don't pass 0666 to open; it's not needed and isn't
guaranteed to be portable.
Diffstat (limited to 'src')
-rw-r--r--src/touch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/touch.c b/src/touch.c
index 7cf1c1b3f..073e42cf2 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;