diff options
author | Jim Meyering <jim@meyering.net> | 2000-04-30 21:48:23 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-04-30 21:48:23 +0000 |
commit | 034fbbd8ac026be60db2e52bb1209c9e31c84fc1 (patch) | |
tree | 910b8944b52150124b35e37f538181e746d38818 /src | |
parent | a65db32955a82c213628d6e5c509d321ac4f4c3c (diff) | |
download | coreutils-034fbbd8ac026be60db2e52bb1209c9e31c84fc1.tar.xz |
(O_NOCTTY): Define if not defined already.
(touch): Add O_NOCTTY to the flags passed to open.
Diffstat (limited to 'src')
-rw-r--r-- | src/touch.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/touch.c b/src/touch.c index 09f5c7cc6..5045790af 100644 --- a/src/touch.c +++ b/src/touch.c @@ -52,6 +52,10 @@ time_t time (); # define O_NONBLOCK O_NDELAY #endif +#if !defined O_NOCTTY +# define O_NOCTTY 0 +#endif + /* The name by which this program was run. */ char *program_name; @@ -131,7 +135,7 @@ touch (const char *file) if (! no_create) { /* Try to open FILE, creating it if necessary. */ - fd = open (file, O_WRONLY | O_CREAT | O_NONBLOCK, + fd = open (file, O_WRONLY | O_CREAT | O_NONBLOCK | O_NOCTTY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (fd == -1) open_errno = errno; |