summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorMohammed Junaid Ahmed <junaid@gluster.com>2011-02-15 11:34:51 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-15 21:44:49 -0800
commit8ce08eb78165c9107925f23ac3057ee2cc01ff2f (patch)
treee22a07333a8bed2d5fdac2506073cb5ba227bcb0 /xlators/mgmt/glusterd/src
parent1569424d1425a2f81c428d3968cd103ab2cad49e (diff)
syncdaemon: Checking for the existence of gsyncd by trying to aquire a lock on the pidfile.
If the locking succeeds then gsyncd is not running and if it fails then it means that gsyncd is running. Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1570 (geosync related changes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 65203328aff..89e6f47c911 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1952,13 +1952,14 @@ gsync_status (char *master, char *slave, int *status)
file = fopen (pidfile, "r+");
if (file) {
- // ret = lockf (fileno (file), F_TEST, 0);
- //if (ret == 0)
- //*status = -1;
- //else
- *status = 0;
+ ret = lockf (fileno (file), F_TEST, 0);
+ if (ret == 0)
+ *status = -1;
+ else
+ *status = 0;
} else
*status = -1;
+ ret = 0;
out:
return ret;
}