diff options
author | Balint Reczey <balint@balintreczey.hu> | 2016-11-30 02:36:06 +0100 |
---|---|---|
committer | Balint Reczey <balint@balintreczey.hu> | 2016-11-30 02:36:06 +0100 |
commit | 365658d0f3a51814626afbb70aa2dd7b5e82ac36 (patch) | |
tree | 7218fb9147359258fda0f9a43da5a29b2d20e85b /src/gpasswd.c | |
parent | bfaa59229d61adb7fa0c570f0d94fd324c6e05aa (diff) | |
download | shadow-365658d0f3a51814626afbb70aa2dd7b5e82ac36.tar.gz |
Imported Upstream version 4.4upstream/4.4
Diffstat (limited to 'src/gpasswd.c')
-rw-r--r-- | src/gpasswd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gpasswd.c b/src/gpasswd.c index 8959a35a..c4a492b1 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -169,9 +169,8 @@ static RETSIGTYPE catch_signals (int killed) } if (0 != killed) { - (void) putchar ('\n'); - (void) fflush (stdout); - exit (killed); + (void) write (STDOUT_FILENO, "\n", 1); + _exit (killed); } } @@ -370,7 +369,7 @@ static void open_files (void) add_cleanup (log_gpasswd_failure_system, NULL); - if (gr_open (O_RDWR) == 0) { + if (gr_open (O_CREAT | O_RDWR) == 0) { fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ()); @@ -380,7 +379,7 @@ static void open_files (void) #ifdef SHADOWGRP if (is_shadowgrp) { - if (sgr_open (O_RDWR) == 0) { + if (sgr_open (O_CREAT | O_RDWR) == 0) { fprintf (stderr, _("%s: cannot open %s\n"), Prog, sgr_dbname ()); |