summaryrefslogtreecommitdiffstats
path: root/sbin/bsdlabel
diff options
context:
space:
mode:
authorlulf <lulf@FreeBSD.org>2008-09-30 11:46:14 +0000
committerlulf <lulf@FreeBSD.org>2008-09-30 11:46:14 +0000
commit54c73027a0ca385bef846cf2c28ace076dfbf7b6 (patch)
treeef5405996c9b4a7b96af27c15c56ff43d380f099 /sbin/bsdlabel
parentc725244bd26d726d10a15a7a2c8068a2bc7b1802 (diff)
downloadFreeBSD-src-54c73027a0ca385bef846cf2c28ace076dfbf7b6.zip
FreeBSD-src-54c73027a0ca385bef846cf2c28ace076dfbf7b6.tar.gz
- A call to close(2) might overwrite errno and thus give a wrong error message
on g_providername failure. Suggested by: pjd Approved by: pjd (mentor)
Diffstat (limited to 'sbin/bsdlabel')
-rw-r--r--sbin/bsdlabel/bsdlabel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 97ddeb6..1cb9995 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -236,11 +236,12 @@ main(int argc, char *argv[])
return(1);
}
pname = g_providername(fd);
- close(fd);
if (pname == NULL) {
warn("error getting providername for %s", specname);
+ close(fd);
return(1);
}
+ close(fd);
}
if (installboot && op == UNSPEC)
OpenPOWER on IntegriCloud