mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2025-01-25 05:04:00 +08:00
btrfs-progs: qgroups show: clean up errno passing
We should use return value for errors, not errno. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
e135ee70b8
commit
4415ff6bcc
@ -296,7 +296,6 @@ static int cmd_qgroup_show(int argc, char **argv)
|
||||
char *path;
|
||||
int ret = 0;
|
||||
int fd;
|
||||
int e;
|
||||
DIR *dirstream = NULL;
|
||||
u64 qgroupid;
|
||||
int filter_flag = 0;
|
||||
@ -383,10 +382,9 @@ static int cmd_qgroup_show(int argc, char **argv)
|
||||
qgroupid);
|
||||
}
|
||||
ret = btrfs_show_qgroups(fd, filter_set, comparer_set);
|
||||
e = errno;
|
||||
close_file_or_dir(fd, dirstream);
|
||||
if (ret < 0)
|
||||
error("can't list qgroups: %s", strerror(e));
|
||||
error("can't list qgroups: %s", strerror(-ret));
|
||||
|
||||
out:
|
||||
return !!ret;
|
||||
|
2
qgroup.c
2
qgroup.c
@ -1067,7 +1067,7 @@ static int __qgroups_search(int fd, struct qgroup_lookup *qgroup_lookup)
|
||||
if (ret < 0) {
|
||||
error("cannot perform the search: %s",
|
||||
strerror(errno));
|
||||
return ret;
|
||||
return -errno;
|
||||
}
|
||||
/* the ioctl returns the number of item it found in nr_items */
|
||||
if (sk->nr_items == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user