summaryrefslogtreecommitdiffstats
path: root/usr.sbin/edquota
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-07-20 01:38:40 +0000
committerguenther <guenther@openbsd.org>2014-07-20 01:38:40 +0000
commitffb4dd050d1e35f39b1d6c1c600db7c6443475c2 (patch)
tree0e41db8f3c733eb324a6a362a29149f077ad4c74 /usr.sbin/edquota
parentDelete unused variables found by -Wall (diff)
downloadwireguard-openbsd-ffb4dd050d1e35f39b1d6c1c600db7c6443475c2.tar.xz
wireguard-openbsd-ffb4dd050d1e35f39b1d6c1c600db7c6443475c2.zip
Make sure the correct errno is reported by warn* or err* and not
the errno of an intervening cleanup operation like close/unlink/etc. Diff from Doug Hogan (doug (at) acyclic.org)
Diffstat (limited to 'usr.sbin/edquota')
-rw-r--r--usr.sbin/edquota/edquota.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index e5ff38c38ab..5e92e1617d4 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -153,8 +153,9 @@ main(int argc, char *argv[])
exit(1);
}
if (editit(tmpfil) == -1) {
+ int saved_errno = errno;
unlink(tmpfil);
- err(1, "error starting editor");
+ errc(1, saved_errno, "error starting editor");
}
if (readtimes(protoprivs, tmpfd))
putprivs(0, quotatype, protoprivs);