summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2009-12-18 12:38:04 +0000
committerVijay Bellur <vijay@dev.gluster.com>2009-12-20 21:38:36 -0800
commit96ae032a9cb9b198f31e26aba30a39e5148a2ba4 (patch)
tree81e731e4cbe0542dddb0cc62dd394a95768bb7e4 /glusterfsd
parent2a51ab19e6370325a5ebac9ed63f8606738919ec (diff)
Support for Compilation on Solaris
This is based on patch at: http://node3.rnode.ru/glusterfs-3.0.0-p1.patch Thanks to Petrunin Egor <shellcode@mail.ru> for this patch. Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 481 (Fix compilation failures in Solaris) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=481
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 01855938e..fb9e6c424 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -928,7 +928,7 @@ cleanup_and_exit (int signum)
gf_log ("glusterfs", GF_LOG_WARNING, "shutting down");
if (ctx->pidfp) {
- flock (fileno (ctx->pidfp), LOCK_UN);
+ lockf (fileno (ctx->pidfp), F_ULOCK, 0);
fclose (ctx->pidfp);
ctx->pidfp = NULL;
}
@@ -1201,7 +1201,8 @@ main (int argc, char *argv[])
#ifdef DEBUG
mtrace ();
#endif
- signal (SIGUSR1, (sighandler_t) gf_proc_dump_info);
+
+ signal (SIGUSR1, gf_proc_dump_info);
signal (SIGSEGV, gf_print_trace);
signal (SIGABRT, gf_print_trace);
signal (SIGPIPE, SIG_IGN);
@@ -1285,8 +1286,8 @@ main (int argc, char *argv[])
/* do cleanup and exit ?! */
return -1;
}
- ret = flock (fileno (ctx->pidfp),
- (LOCK_EX | LOCK_NB));
+ ret = lockf (fileno (ctx->pidfp),
+ (F_LOCK | F_TLOCK), 0);
if (ret == -1) {
gf_log ("glusterfs", GF_LOG_ERROR,
"Is another instance of %s running?",
@@ -1305,7 +1306,7 @@ main (int argc, char *argv[])
"unable to truncate file %s. %s.",
cmd_args->pid_file,
strerror (errno));
- flock (fileno (ctx->pidfp), LOCK_UN);
+ lockf (fileno (ctx->pidfp), F_ULOCK, 0);
fclose (ctx->pidfp);
if (write (pipe_fd[1], &gf_failure,
sizeof (int)) < 0) {