]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
blkid: use O_CLOEXEC
authorKarel Zak <kzak@redhat.com>
Wed, 3 Apr 2013 14:14:47 +0000 (16:14 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Apr 2013 14:14:47 +0000 (16:14 +0200)
... to make "strace -e open blkid" for libblkid stuff without
exceptions.

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/blkid.c

index fd27da7f04aecf873f43f97d1495f205d33e139e..f67ee4490b229fcde4fbec7c48a8b4439911a24c 100644 (file)
@@ -493,7 +493,7 @@ static int lowprobe_device(blkid_probe pr, const char *devname,
        int rc = 0;
        static int first = 1;
 
-       fd = open(devname, O_RDONLY);
+       fd = open(devname, O_RDONLY|O_CLOEXEC);
        if (fd < 0) {
                fprintf(stderr, "error: %s: %m\n", devname);
                return BLKID_EXIT_NOTFOUND;