From 122db55d605b66a4c6b74a86c9cb74dd9007c866 Mon Sep 17 00:00:00 2001 From: lizf Date: Mon, 22 Oct 2007 11:26:27 +0800 Subject: [PATCH] blockdev: fix: opened file leaving unclosed Signed-off-by: Li Zefan --- disk-utils/blockdev.c | 4 ++++ disk-utils/isosize.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c index d02ebbce..474d0dbf 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 2064021f..3f22ab86 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 -- 2.39.5