* src/vipw.c: Likewise for the backup file.

This commit is contained in:
nekral-guest
2009-03-21 19:28:02 +00:00
parent 5331930716
commit a65c2c9b18
2 changed files with 3 additions and 1 deletions

View File

@ -112,7 +112,8 @@ static int create_backup_file (FILE * fp, const char *backup, struct stat *sb)
unlink (backup);
return -1;
}
if (fclose (bkfp) != 0) {
if ( (fsync (fileno (bkfp)) != 0)
|| (fclose (bkfp) != 0)) {
unlink (backup);
return -1;
}