X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Futils%2Fgetmail.c;h=ee606bb2af1ec6cede3fcd021a2e26fb4325e58f;hp=087ee034fa4a3f4e1259f504ce1c73ffd43d26ec;hb=feb542114454b1f979c025ede9474f53b6715bce;hpb=8ab55c43ca0ef3ab0c63da570bcc0f3613cee0f8 diff --git a/citadel/utils/getmail.c b/citadel/utils/getmail.c index 087ee034f..ee606bb2a 100644 --- a/citadel/utils/getmail.c +++ b/citadel/utils/getmail.c @@ -53,32 +53,6 @@ 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 @@ -88,7 +62,6 @@ void remove_lockfile(void) */ void nq_cleanup(int e) { - remove_lockfile(); exit(e); }