btrfs-progs: drop permission arg from non-creating open
authorDavid Sterba <dsterba@suse.com>
Thu, 1 Sep 2016 17:38:23 +0000 (19:38 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Sep 2016 08:05:35 +0000 (10:05 +0200)
The permissions do not make sense without O_CREATE mode.

Signed-off-by: David Sterba <dsterba@suse.com>
cmds-inspect-dump-super.c
super-recover.c

index 3e09ee8c6eedb219120a22e7fc599207bb13745e..38e99ec1c4e7adb48168b34fdb1eacd17635e0f1 100644 (file)
@@ -511,7 +511,7 @@ int cmd_inspect_dump_super(int argc, char **argv)
 
        for (i = optind; i < argc; i++) {
                filename = argv[i];
-               fd = open(filename, O_RDONLY, 0666);
+               fd = open(filename, O_RDONLY);
                if (fd < 0) {
                        error("cannot open %s: %s", filename, strerror(errno));
                        ret = 1;
index 1dc3fc7d12e6f3c44f9711a569f2b722d54b265b..635e804b5f50297009047928e29e405c498066e0 100644 (file)
@@ -138,7 +138,7 @@ read_dev_supers(char *filename, struct btrfs_recover_superblock *recover)
 
        struct btrfs_super_block *sb = (struct btrfs_super_block *)buf;
 
-       fd = open(filename, O_RDONLY, 0666);
+       fd = open(filename, O_RDONLY);
        if (fd < 0)
                return -errno;