diff options
author | Gui Hecheng <guihc.fnst@cn.fujitsu.com> | 2014-02-20 10:49:05 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-03-21 06:23:22 -0700 |
commit | 002d5e14304aae3c4df45b36f99cdeec51a87b4c (patch) | |
tree | 70f3414a62f7cc90a5abba85737c102720316a4f /utils.c | |
parent | 51a40f6df01ea7e0673bd1b50a0d28e1def345f2 (diff) |
btrfs-progs: fix wrong error msg for exec btrfsck as non-root
When exec btrfsck as non-root user on a disk, btrfsck will always
warn that "No such file or directory", despite that a directory
(e.g. /dev/vboxusb)actually exists. We just have no permission.
In this case, return the -errno set by the opendir call in
btrfs_scan_one_dir rather than blindly return -ENOENT.
Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1111,7 +1111,7 @@ again: dirp = opendir(dirname); if (!dirp) { fprintf(stderr, "Unable to open %s for scanning\n", dirname); - ret = -ENOENT; + ret = -errno; goto fail; } while(1) { |