diff options
author | Renato Botelho <renato@netgate.com> | 2017-01-09 12:10:25 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-09 12:10:25 -0200 |
commit | cbeab2a9b6b7ac70992175202f35fcc05a5821d5 (patch) | |
tree | 24d02a6f1a29ee4c3fb5d883ca942508853f4e52 /lib/libutil/gr_util.c | |
parent | cc9fac304cafadab4656653aa1a62fdad74b4e94 (diff) | |
download | FreeBSD-src-cbeab2a9b6b7ac70992175202f35fcc05a5821d5.zip FreeBSD-src-cbeab2a9b6b7ac70992175202f35fcc05a5821d5.tar.gz |
Revert "Import review D5409"
This reverts commit 728813a02a03cdab41bffc21d729fb394aef805c.
Diffstat (limited to 'lib/libutil/gr_util.c')
-rw-r--r-- | lib/libutil/gr_util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c index 1acbadb..80d9ee6 100644 --- a/lib/libutil/gr_util.c +++ b/lib/libutil/gr_util.c @@ -141,13 +141,13 @@ gr_tmp(int mfd) errno = ENAMETOOLONG; return (-1); } - if ((tfd = mkstemp(tempname)) == -1) + if ((tfd = mkostemp(tempname, O_SYNC)) == -1) return (-1); if (mfd != -1) { while ((nr = read(mfd, buf, sizeof(buf))) > 0) if (write(tfd, buf, (size_t)nr) != nr) break; - if (nr != 0 || fsync(tfd) != 0) { + if (nr != 0) { unlink(tempname); *tempname = '\0'; close(tfd); @@ -305,8 +305,6 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr) done: if (line != NULL) free(line); - if (fsync(tfd) != 0) - goto err; return (0); err: if (line != NULL) |