summaryrefslogtreecommitdiff
path: root/sbin/disklabel
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-07-20 01:38:41 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-07-20 01:38:41 +0000
commit7a28608cfded6ad958b67771de221d7e4f65d5a4 (patch)
treec9cf52f6b8ea60c0fae8134d5226210f7c1d3ae8 /sbin/disklabel
parent86c2401ccbc07e58588ca73b92b27ab89e9e671f (diff)
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 'sbin/disklabel')
-rw-r--r--sbin/disklabel/disklabel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index e3daa538332..6955b45db66 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.195 2014/05/05 16:33:34 krw Exp $ */
+/* $OpenBSD: disklabel.c,v 1.196 2014/07/20 01:38:40 guenther Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -816,9 +816,9 @@ edit(struct disklabel *lp, int f)
u_int64_t total_sectors, starting_sector, ending_sector;
if ((fd = mkstemp(tmpfil)) == -1 || (fp = fdopen(fd, "w")) == NULL) {
+ warn("%s", tmpfil);
if (fd != -1)
close(fd);
- warn("%s", tmpfil);
return (1);
}
display(fp, lp, 0, 1);