summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 987244e7518..2b5c1c6ca1e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4388,17 +4388,27 @@ glusterd_is_uuid_present (char *path, char *xattr, gf_boolean_t *present)
goto out;
ret = sys_lgetxattr (path, xattr, &uid, 16);
- if (ret < 0 && errno != ENODATA) {
- goto out;
- } else if (ret >= 0) {
+ if (ret >= 0) {
*present = _gf_true;
-
- } else {
- *present = _gf_false;
+ ret = 0;
+ goto out;
+ }
+
+ switch (errno) {
+#if defined(ENODATA)
+ case ENODATA: /* FALLTHROUGH */
+#endif
+#if defined(ENOATTR) && (ENOATTR != ENODATA)
+ case ENOATTR: /* FALLTHROUGH */
+#endif
+ case ENOTSUP:
+ *present = _gf_false;
+ ret = 0;
+ break;
+ default:
+ break;
}
-
- ret = 0;
out:
return ret;
}
@@ -4433,7 +4443,7 @@ glusterd_is_path_in_use (char *path, gf_boolean_t *in_use, char **op_errstr)
if (used)
break;
- curdir = dirname (dir);
+ curdir = dirname (curdir);
if (!strcmp (curdir, "."))
goto out;