aboutsummaryrefslogtreecommitdiff
path: root/sbin/bsdlabel/bsdlabel.c
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2010-12-01 08:07:32 +0000
committerKevin Lo <kevlo@FreeBSD.org>2010-12-01 08:07:32 +0000
commita2299ad8e5c2ff1bd7ecd849489e1d073be22e10 (patch)
treecb64b2ed8aed5486448cc8ddca55080b5562086a /sbin/bsdlabel/bsdlabel.c
parentb9895f9add68c3a63535cb0b39d8a4ad6880bc0c (diff)
downloadsrc-a2299ad8e5c2ff1bd7ecd849489e1d073be22e10.tar.gz
src-a2299ad8e5c2ff1bd7ecd849489e1d073be22e10.zip
Closing file descriptors when it's done
Notes
Notes: svn path=/head/; revision=216095
Diffstat (limited to 'sbin/bsdlabel/bsdlabel.c')
-rw-r--r--sbin/bsdlabel/bsdlabel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 974150d81fc5..4e8ac1adf43d 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -370,10 +370,12 @@ readboot(void)
p[60] = (st.st_size + secsize - 1) / secsize;
p[61] = 1;
p[62] = 0;
+ close(fd);
return;
} else if ((!alphacksum) && st.st_size <= BBSIZE) {
if (read(fd, bootarea, st.st_size) != st.st_size)
err(1, "read error %s", xxboot);
+ close(fd);
return;
}
errx(1, "boot code %s is wrong size", xxboot);