projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9dd21cb
)
remove unused code for locking
author
Wilfried Goesgens
<dothebart@citadel.org>
Wed, 7 Sep 2011 21:07:09 +0000
(21:07 +0000)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Wed, 7 Sep 2011 21:09:28 +0000
(21:09 +0000)
citadel/utils/sendcommand.c
patch
|
blob
|
history
diff --git
a/citadel/utils/sendcommand.c
b/citadel/utils/sendcommand.c
index 52d05258da58e69da24eb60a8f285ea842e9d2e6..e562602af3b5bf28494e3b2cd7ea3a4e9c28d398 100644
(file)
--- a/
citadel/utils/sendcommand.c
+++ b/
citadel/utils/sendcommand.c
@@
-49,36
+49,8
@@
#include "server.h"
#include "config.h"
#include "server.h"
#include "config.h"
-#define LOCKFILE "/tmp/LCK.sendcommand"
-
static CtdlIPC *ipc = NULL;
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
/*
* 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");
{
if (e == SIGALRM)
fprintf(stderr, "\nWatch dog time out.\n");
- remove_lockfile();
exit(e);
}
exit(e);
}