summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-06-21 02:00:23 -0700
committerHarshavardhana <harsha@harshavardhana.net>2014-07-02 17:20:34 -0700
commit1b74cf992986287a510fe3b28a8ee7554e8b0992 (patch)
treea5fad911274080947f5874b4d90cc4f67b6f4473 /xlators/mgmt/glusterd/src/glusterd-utils.c
parente4a3566681acbadfe0f7bd879443116885ada4eb (diff)
porting: Port for FreeBSD rebased from Mike Ma's efforts
- Provides a working Gluster Management Daemon, CLI - Provides a working GlusterFS server, GlusterNFS server - Provides a working GlusterFS client - execinfo port from FreeBSD is moved into ./contrib/libexecinfo for ease of portability on NetBSD. (FreeBSD 10 and OSX provide execinfo natively) - More portability cleanups for Darwin, FreeBSD and NetBSD - Provides a new rc script for FreeBSD Change-Id: I8dff336f97479ca5a7f9b8c6b730051c0f8ac46f BUG: 1111774 Original-Author: Mike Ma <mikemandarine@gmail.com> Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8141 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index fb677200a7e..6b973a3638d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -13,7 +13,7 @@
#endif
#include <inttypes.h>
-#if !defined(__NetBSD__) && !defined(GF_DARWIN_HOST_OS)
+#if defined(GF_LINUX_HOST_OS)
#include <mntent.h>
#else
#include "mntent_compat.h"
@@ -722,7 +722,7 @@ glusterd_snap_volinfo_restore (dict_t *dict, dict_t *rsp_dict,
new_volinfo->volume_id,
sizeof (new_volinfo->volume_id),
XATTR_REPLACE);
- if (ret) {
+ if (ret == -1) {
gf_log (this->name, GF_LOG_ERROR, "Failed to "
"set extended attribute %s on %s. "
"Reason: %s, snap: %s",
@@ -7438,7 +7438,6 @@ glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo,
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
-
GF_ASSERT (volinfo);
GF_ASSERT (brickinfo);
GF_ASSERT (dict);
@@ -8109,7 +8108,7 @@ glusterd_check_and_set_brick_xattr (char *host, char *path, uuid_t uuid,
/* Check for xattr support in backend fs */
ret = sys_lsetxattr (path, "trusted.glusterfs.test",
"working", 8, 0);
- if (ret) {
+ if (ret == -1) {
snprintf (msg, sizeof (msg), "Glusterfs is not"
" supported on brick: %s:%s.\nSetting"
" extended attributes failed, reason:"
@@ -8135,7 +8134,7 @@ glusterd_check_and_set_brick_xattr (char *host, char *path, uuid_t uuid,
ret = sys_lsetxattr (path, GF_XATTR_VOL_ID_KEY, uuid, 16,
flags);
- if (ret) {
+ if (ret == -1) {
snprintf (msg, sizeof (msg), "Failed to set extended "
"attributes %s, reason: %s",
GF_XATTR_VOL_ID_KEY, strerror (errno));