diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-10-30 03:28:40 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-30 03:37:47 -0700 |
commit | 44f6b7a54224dde7e1663f435f05a6a5cac25a7b (patch) | |
tree | bafaee1f0a812ef063d8c085b44ba73011ab34bb /booster | |
parent | 10cddf14e9f7a7446ea48bedb07ee9e7d0f21e4f (diff) |
booster: Must check errno for error number not return value
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 346 (booster returns success on failed getxattr and lgetxattr)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=346
Diffstat (limited to 'booster')
-rw-r--r-- | booster/src/booster.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c index 3f171646c..00352d621 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -2296,7 +2296,7 @@ getxattr (const char *path, const char *name, void *value, size_t size) gf_log ("booster", GF_LOG_TRACE, "getxattr: path %s, name %s", path, name); ret = glusterfs_getxattr (path, name, value, size); - if ((ret == -1) && (ret != ENODEV)) { + if ((ret == -1) && (errno != ENODEV)) { gf_log ("booster", GF_LOG_ERROR, "getxattr failed: %s", strerror (errno)); goto out; @@ -2327,11 +2327,11 @@ lgetxattr (const char *path, const char *name, void *value, size_t size) gf_log ("booster", GF_LOG_TRACE, "lgetxattr: path %s, name %s", path, name); ret = glusterfs_lgetxattr (path, name, value, size); - if ((ret == -1) && (ret != ENODEV)) { + if ((ret == -1) && (errno != ENODEV)) { gf_log ("booster", GF_LOG_ERROR, "lgetxattr failed: %s", strerror (errno)); - return ret; + goto out; } if (ret > 0) { |