summaryrefslogtreecommitdiff
path: root/src/gpasswd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpasswd.c')
-rw-r--r--src/gpasswd.c9
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 ());