summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorlizf2007-10-22 05:26:27 +0200
committerKarel Zak2007-10-26 01:02:45 +0200
commit122db55d605b66a4c6b74a86c9cb74dd9007c866 (patch)
tree198fa4e1ec589c33fc3c22761752f3c38600c489 /disk-utils
parentsfdisk: opened files leaving unclosed (diff)
downloadkernel-qcow2-util-linux-122db55d605b66a4c6b74a86c9cb74dd9007c866.tar.gz
kernel-qcow2-util-linux-122db55d605b66a4c6b74a86c9cb74dd9007c866.tar.xz
kernel-qcow2-util-linux-122db55d605b66a4c6b74a86c9cb74dd9007c866.zip
blockdev: fix: opened file leaving unclosed
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/blockdev.c4
-rw-r--r--disk-utils/isosize.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c
index d02ebbce0..474d0dbfe 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -394,6 +394,8 @@ report_all_devices(void) {
sprintf(device, "/dev/%s", ptname);
report_device(device, 1);
}
+
+ fclose(procpt);
}
void
@@ -427,6 +429,8 @@ report_device(char *device, int quiet) {
fprintf(stderr, _("%s: ioctl error on %s\n"),
progname, device);
}
+
+ close(fd);
}
void
diff --git a/disk-utils/isosize.c b/disk-utils/isosize.c
index 2064021fa..3f22ab865 100644
--- a/disk-utils/isosize.c
+++ b/disk-utils/isosize.c
@@ -159,6 +159,8 @@ isosize(char *filenamep) {
else
printf ("%lld\n", (product * ssize) / divisor);
}
+
+ close(fd);
}
int