X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Futils%2Fgetmail.c;h=ee606bb2af1ec6cede3fcd021a2e26fb4325e58f;hb=feb542114454b1f979c025ede9474f53b6715bce;hp=af9780cb8bad99840da4aea3a90b0e0d0d1f55cf;hpb=c61307c63378edc18a9adbd628f5fbfc4a78025c;p=citadel.git diff --git a/citadel/utils/getmail.c b/citadel/utils/getmail.c index af9780cb8..ee606bb2a 100644 --- a/citadel/utils/getmail.c +++ b/citadel/utils/getmail.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Command-line utility to transmit a server command. * * Copyright (c) 1987-2009 by the citadel.org team @@ -55,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 @@ -90,7 +62,6 @@ void remove_lockfile(void) */ void nq_cleanup(int e) { - remove_lockfile(); exit(e); }