summaryrefslogtreecommitdiff
path: root/libbb/update_passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/update_passwd.c')
-rw-r--r--libbb/update_passwd.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c
index ba773fc..301893b 100644
--- a/libbb/update_passwd.c
+++ b/libbb/update_passwd.c
@@ -137,12 +137,7 @@ int FAST_FUNC update_passwd(const char *filename,
fchown(new_fd, sb.st_uid, sb.st_gid);
}
errno = 0;
- new_fp = fdopen(new_fd, "w");
- if (!new_fp) {
- bb_perror_nomsg();
- close(new_fd);
- goto unlink_new;
- }
+ new_fp = xfdopen_for_write(new_fd);
/* Backup file is "/etc/passwd-" */
*sfx_char = '-';