summaryrefslogtreecommitdiff
path: root/cmds-qgroup.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl-fnst@cn.fujitsu.com>2013-02-27 19:04:18 +0800
committerDavid Sterba <dsterba@suse.cz>2013-02-27 16:13:20 +0100
commite929e2947a52bedc91b674202ebff8a4cc21b794 (patch)
treedd26bf2c91b73ab89ea6d70588baa24187ac145d /cmds-qgroup.c
parent9f166a337cbadcc98673e5f171aff7cd8b5936f2 (diff)
Btrfs-progs: output the error reason when qgroup_show fails
The original code forgot to output the reason why the commands failed, fix it. Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Diffstat (limited to 'cmds-qgroup.c')
-rw-r--r--cmds-qgroup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index 79888c83..275f00fc 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
@@ -298,6 +298,7 @@ static int cmd_qgroup_show(int argc, char **argv)
{
int ret = 0;
int fd;
+ int e;
char *path = argv[1];
if (check_argc_exact(argc, 2))
@@ -310,9 +311,11 @@ static int cmd_qgroup_show(int argc, char **argv)
}
ret = list_qgroups(fd);
+ e = errno;
close(fd);
if (ret < 0) {
- fprintf(stderr, "ERROR: can't list qgroups\n");
+ fprintf(stderr, "ERROR: can't list qgroups: %s\n",
+ strerror(e));
return 30;
}