btrfs-progs: drop permission arg from non-creating open

The permissions do not make sense without O_CREATE mode.

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2016-09-01 19:38:23 +02:00
parent 51d41fac76
commit df96f8244d
2 changed files with 2 additions and 2 deletions

View 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;

View 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;