]> err.no Git - util-linux/commitdiff
blockdev: fix: opened file leaving unclosed
authorlizf <lizf@cn.fujitsu.com>
Mon, 22 Oct 2007 03:26:27 +0000 (11:26 +0800)
committerKarel Zak <kzak@redhat.com>
Thu, 25 Oct 2007 23:02:45 +0000 (01:02 +0200)
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
disk-utils/blockdev.c
disk-utils/isosize.c

index d02ebbce0aaf59c639b7a93988ecb8c4dd2ce25e..474d0dbfeb484d7f5e23d62037ff14778c5abada 100644 (file)
@@ -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
index 2064021faf0794448d317a2844229775bf4d776c..3f22ab8654e316ffec6c8d1f17f97def1432ea77 100644 (file)
@@ -159,6 +159,8 @@ isosize(char *filenamep) {
                else
                        printf ("%lld\n", (product * ssize) / divisor);
        }
+
+       close(fd);
 }
 
 int