summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 5ea542ab013..b79753519b3 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1201,7 +1201,7 @@ glusterfs_pidfile_setup (glusterfs_ctx_t *ctx)
int
glusterfs_pidfile_cleanup (glusterfs_ctx_t *ctx)
{
- cmd_args_t *cmd_args = NULL;
+ cmd_args_t *cmd_args = NULL;
cmd_args = &ctx->cmd_args;
@@ -1209,18 +1209,18 @@ glusterfs_pidfile_cleanup (glusterfs_ctx_t *ctx)
return 0;
gf_log ("glusterfsd", GF_LOG_TRACE,
- "pidfile %s unlocking",
+ "pidfile %s cleanup",
cmd_args->pid_file);
- lockf (fileno (ctx->pidfp), F_ULOCK, 0);
- fclose (ctx->pidfp);
- ctx->pidfp = NULL;
-
if (ctx->cmd_args.pid_file) {
unlink (ctx->cmd_args.pid_file);
ctx->cmd_args.pid_file = NULL;
}
+ lockf (fileno (ctx->pidfp), F_ULOCK, 0);
+ fclose (ctx->pidfp);
+ ctx->pidfp = NULL;
+
return 0;
}