summaryrefslogtreecommitdiff
path: root/cmds-inspect.c
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2015-10-12 21:22:58 +0800
committerDavid Sterba <dsterba@suse.com>2015-11-02 09:35:01 +0100
commitb570afae4d5648dd8edfab62e84a8fd987ff1f67 (patch)
treecb9f44defe663dd304f0c81775a45f52ebad98c5 /cmds-inspect.c
parent97a9818716f023e67171229cbe087053132df70b (diff)
btrfs-progs: inspect: set return value of error case
In case of open_file_or_dir() failed, ret is not set to right value, and the function will return unwanted value(ret of sprintf). Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-inspect.c')
-rw-r--r--cmds-inspect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmds-inspect.c b/cmds-inspect.c
index 879fd43..a13a170 100644
--- a/cmds-inspect.c
+++ b/cmds-inspect.c
@@ -243,6 +243,7 @@ static int cmd_inspect_logical_resolve(int argc, char **argv)
if (path_fd < 0) {
fprintf(stderr, "ERROR: can't access "
"'%s'\n", full_path);
+ ret = -ENOENT;
goto out;
}
}