From 6433ed0a9e2d0b4f6c97342ba31ba77b7c364c50 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Wed, 7 Sep 2011 21:07:09 +0000 Subject: [PATCH] remove unused code for locking --- citadel/utils/sendcommand.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/citadel/utils/sendcommand.c b/citadel/utils/sendcommand.c index 52d05258d..e562602af 100644 --- a/citadel/utils/sendcommand.c +++ b/citadel/utils/sendcommand.c @@ -49,36 +49,8 @@ #include "server.h" #include "config.h" -#define LOCKFILE "/tmp/LCK.sendcommand" - static CtdlIPC *ipc = NULL; -/* - * make sure only one copy of sendcommand runs at a time, using lock files - */ -int set_lockfile(void) -{ - FILE *lfp; - int onppid; - int rv; - - if ((lfp = fopen(LOCKFILE, "r")) != NULL) { - rv = fscanf(lfp, "%d", &onppid); - fclose(lfp); - if (!kill(onppid, 0) || errno == EPERM) - return 1; - } - lfp = fopen(LOCKFILE, "w"); - fprintf(lfp, "%ld\n", (long) getpid()); - fclose(lfp); - return (0); -} - -void remove_lockfile(void) -{ - unlink(LOCKFILE); -} - /* * Why both cleanup() and nq_cleanup() ? Notice the alarm() call in * cleanup() . If for some reason sendcommand hangs waiting for the server @@ -90,7 +62,6 @@ void nq_cleanup(int e) { if (e == SIGALRM) fprintf(stderr, "\nWatch dog time out.\n"); - remove_lockfile(); exit(e); } -- 2.30.2