summaryrefslogtreecommitdiff
path: root/props.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2014-04-15 17:22:24 +0800
committerDavid Sterba <dsterba@suse.cz>2014-04-22 14:35:15 +0200
commit802ed8c3520897369e65c56b204babbc28ebed40 (patch)
tree7b8d91238c95b9cabfa358fa1a0653d716e8850f /props.c
parentccd14cbf62026fd84113bcf886732fcc3391cb5b (diff)
btrfs-progs: Fix the return value when executing 'btrfs prop get' on an uncompressed file
When executing 'btrfs prop get' on a file which is not compressed, return value will always be 50 since prop_compress() return -ENOATTR. But the codes have already check the errno to avoid unnecessary error message, so the return value should also set to 0. Signed-off-by: Qu Wenruo <quwenro@cn.fujitsu.com> Reviewed-by: Filipe Manana <fdmanana@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'props.c')
-rw-r--r--props.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/props.c b/props.c
index 4d0aeeab..c09865b3 100644
--- a/props.c
+++ b/props.c
@@ -142,10 +142,12 @@ static int prop_compression(enum prop_object_type type,
sret = fgetxattr(fd, xattr_name, NULL, 0);
if (sret < 0) {
ret = -errno;
- if (ret != -ENODATA)
+ if (ret != -ENOATTR)
fprintf(stderr,
"ERROR: failed to %s compression for %s. %s\n",
value ? "set" : "get", object, strerror(-ret));
+ else
+ ret = 0;
goto out;
}
if (!value) {