* [PATCH 2/2] Btrfs-progs: output the error reason when qgroup_show fails
@ 2013-02-27 11:04 Wang Shilong
0 siblings, 0 replies; only message in thread
From: Wang Shilong @ 2013-02-27 11:04 UTC (permalink / raw)
To: linux-btrfs; +Cc: wangshilong1991
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
The original code forgot to output the reason why the commands failed,
fix it.
Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
---
cmds-qgroup.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index 79888c8..275f00f 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;
}
--
1.7.7.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-02-27 11:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27 11:04 [PATCH 2/2] Btrfs-progs: output the error reason when qgroup_show fails Wang Shilong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).