diff options
author | kevlo <kevlo@FreeBSD.org> | 2010-12-01 08:07:32 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2010-12-01 08:07:32 +0000 |
commit | 33ed69008df8b949df3749aec9a0b953bb966153 (patch) | |
tree | cb64b2ed8aed5486448cc8ddca55080b5562086a /sbin | |
parent | de534f68878e535c6f9bd447f194608d26b5c5cb (diff) | |
download | FreeBSD-src-33ed69008df8b949df3749aec9a0b953bb966153.zip FreeBSD-src-33ed69008df8b949df3749aec9a0b953bb966153.tar.gz |
Closing file descriptors when it's done
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/bsdlabel/bsdlabel.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 974150d..4e8ac1a 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); |