[PATCH 2/3] btrfs-progs: output the correct path when fi-usage failed

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

 



When we exec the following cmd:
	# btrfs file usage -t <path>  <-- an invalid path
output:
	# ERROR: can't access '-t'
should be:
	# ERROR: can't access 'path'

Just replace the static 'argv[1]' with 'argv[i]'.
---
 cmds-fi-disk_usage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmds-fi-disk_usage.c b/cmds-fi-disk_usage.c
index 78dc414..1f4c88e 100644
--- a/cmds-fi-disk_usage.c
+++ b/cmds-fi-disk_usage.c
@@ -835,7 +835,7 @@ int cmd_filesystem_usage(int argc, char **argv)
 		fd = open_file_or_dir(argv[i], &dirstream);
 		if (fd < 0) {
 			fprintf(stderr, "ERROR: can't access '%s'\n",
-				argv[1]);
+				argv[i]);
 			ret = 1;
 			goto out;
 		}
-- 
1.8.1.4

--
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