Message ID | 089dd78bdaf8e25721ba718248a66b00e1b68284.1444655800.git.zhaolei@cn.fujitsu.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
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; } }
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> --- cmds-inspect.c | 1 + 1 file changed, 1 insertion(+)