summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2010-05-17 07:09:13 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-21 00:31:51 -0700
commit11fb070964adf57eea4191d315a752c96f80a426 (patch)
tree8a66a5cfe14fe22315c2bfe0ea1667b8c6ab0349 /glusterfsd/src
parentbfb10f41a8e3fe7326f507451459529c5b39b72e (diff)
OS X: adjustments, minor fixes to eliminate warnings
Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 361 (GlusterFS 3.0 should work on Mac OS/X) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=361
Diffstat (limited to 'glusterfsd/src')
-rw-r--r--glusterfsd/src/Makefile.am6
-rw-r--r--glusterfsd/src/glusterfsd.c16
2 files changed, 20 insertions, 2 deletions
diff --git a/glusterfsd/src/Makefile.am b/glusterfsd/src/Makefile.am
index 060917930..38151fd5c 100644
--- a/glusterfsd/src/Makefile.am
+++ b/glusterfsd/src/Makefile.am
@@ -1,6 +1,9 @@
sbin_PROGRAMS = glusterfsd
glusterfsd_SOURCES = glusterfsd.c fetch-spec.c
+if GF_DARWIN_HOST_OS
+glusterfsd_SOURCES += $(CONTRIBDIR)/apple/daemon.c
+endif
glusterfsd_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la $(GF_LDADD)
glusterfsd_LDFLAGS = $(GF_LDFLAGS) $(GF_GLUSTERFS_LDFLAGS)
noinst_HEADERS = glusterfsd.h
@@ -8,6 +11,9 @@ noinst_HEADERS = glusterfsd.h
AM_CFLAGS = -fPIC -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D$(GF_HOST_OS)\
-I$(top_srcdir)/libglusterfs/src -DDATADIR=\"$(localstatedir)\" \
-DCONFDIR=\"$(sysconfdir)/glusterfs\" $(GF_GLUSTERFS_CFLAGS)
+if GF_DARWIN_HOST_OS
+AM_CFLAGS += -I$(CONTRIBDIR)/apple
+endif
CLEANFILES =
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index afd9cafa6..8ffa3ac46 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -73,6 +73,13 @@
#include <fnmatch.h>
+#ifdef GF_DARWIN_HOST_OS
+#include "daemon.h"
+#else
+#define os_daemon(u, v) daemon (u, v)
+#endif
+
+
/* using argp for command line parsing */
static char gf_doc[] = "";
static char argp_doc[] = "--volfile-server=SERVER [MOUNT-POINT]\n" \
@@ -207,7 +214,7 @@ gf_daemon (int *pipe_fd)
/*child continues*/
close (pipe_fd[0]);
- if (daemon (0, 0) == -1) {
+ if (os_daemon (0, 0) == -1) {
gf_log ("glusterfs", GF_LOG_ERROR,
"unable to run in daemon mode: %s",
strerror (errno));
@@ -1063,7 +1070,12 @@ zr_build_process_uuid ()
localtime_r (&tv.tv_sec, &now);
strftime (now_str, 32, "%Y/%m/%d-%H:%M:%S", &now);
- snprintf (tmp_str, 1024, "%s-%d-%s:%ld",
+ snprintf (tmp_str, 1024, "%s-%d-%s:%"
+#ifdef GF_DARWIN_HOST_OS
+ PRId32,
+#else
+ "ld",
+#endif
hostname, getpid(), now_str, tv.tv_usec);
return gf_strdup (tmp_str);