diff options
author | Fan Chengniang <fancn.fnst@cn.fujitsu.com> | 2015-02-10 18:23:13 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-02-27 17:27:26 +0100 |
commit | 7a7d5f019f9998912ead63d3491407d2218e9874 (patch) | |
tree | be6869f0f6e9a441c14dc70c4be4cda4c18deac6 /qgroup.c | |
parent | ddb0ba2dad63898020df7f6e708d382155229be0 (diff) | |
download | btrfs-progs-7a7d5f019f9998912ead63d3491407d2218e9874.tar.gz |
btrfs-progs: use correct the return value
The return values 12 and 13 are not used spectially except as return
value. No description and definition about them. so I change them to
generic errno.
Signed-off-by: Fan Chengniang <fancn.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'qgroup.c')
-rw-r--r-- | qgroup.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -21,6 +21,7 @@ #include "ctree.h" #include "ioctl.h" #include "utils.h" +#include <errno.h> #define BTRFS_QGROUP_NFILTERS_INCREASE (2 * BTRFS_QGROUP_FILTER_MAX) #define BTRFS_QGROUP_NCOMPS_INCREASE (2 * BTRFS_QGROUP_COMP_MAX) @@ -1294,7 +1295,7 @@ qgroup_inherit_realloc(struct btrfs_qgroup_inherit **inherit, int n, int pos) out = calloc(sizeof(*out) + sizeof(out->qgroups[0]) * (nitems + n), 1); if (out == NULL) { fprintf(stderr, "ERROR: Not enough memory\n"); - return 13; + return -ENOMEM; } if (*inherit) { @@ -1322,7 +1323,7 @@ int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg) if (qgroupid == 0) { fprintf(stderr, "ERROR: bad qgroup specification\n"); - return 12; + return -EINVAL; } if (*inherit) @@ -1349,7 +1350,7 @@ int qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg, if (!p) { bad: fprintf(stderr, "ERROR: bad copy specification\n"); - return 12; + return -EINVAL; } *p = 0; qgroup_src = parse_qgroupid(arg); |