[PATCH 05/11] btrfs-progs: inspect: set return value of error case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 cmds-inspect.c | 1 +
 1 file changed, 1 insertion(+)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux