From: lizf Date: Mon, 22 Oct 2007 03:26:27 +0000 (+0800) Subject: blockdev: fix: opened file leaving unclosed X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=122db55d605b66a4c6b74a86c9cb74dd9007c866;p=util-linux blockdev: fix: opened file leaving unclosed Signed-off-by: Li Zefan --- 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