mirror of
https://github.com/kdave/btrfs-progs
synced 2025-03-01 00:10:41 +00:00
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>
This commit is contained in:
parent
9f166a337c
commit
e929e2947a
@ -298,6 +298,7 @@ static int cmd_qgroup_show(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int fd;
|
int fd;
|
||||||
|
int e;
|
||||||
char *path = argv[1];
|
char *path = argv[1];
|
||||||
|
|
||||||
if (check_argc_exact(argc, 2))
|
if (check_argc_exact(argc, 2))
|
||||||
@ -310,9 +311,11 @@ static int cmd_qgroup_show(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = list_qgroups(fd);
|
ret = list_qgroups(fd);
|
||||||
|
e = errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "ERROR: can't list qgroups\n");
|
fprintf(stderr, "ERROR: can't list qgroups: %s\n",
|
||||||
|
strerror(e));
|
||||||
return 30;
|
return 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user