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>
master
David Sterba 2017-01-20 17:41:55 +01:00
parent e135ee70b8
commit 4415ff6bcc
2 changed files with 2 additions and 4 deletions

View File

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

View File

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