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>
This commit is contained in:
Zhao Lei 2015-10-12 21:22:58 +08:00 committed by David Sterba
parent 97a9818716
commit b570afae4d

View File

@ -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;
}
}