Commit 3c839e76 authored by Eric S. Raymond's avatar Eric S. Raymond

This refactored version works.

svn path=/trunk/; revision=3228
parent 5c4a6c30
......@@ -26,11 +26,11 @@ void lock_setup(void)
/* set up to do lock protocol */
#define FETCHMAIL_PIDFILE "fetchmail.pid"
if (!getuid()) {
xalloca(lockfile, char *,
lockfile = (char *)xmalloc(
sizeof(PID_DIR) + sizeof(FETCHMAIL_PIDFILE));
sprintf(lockfile, "%s/%s", PID_DIR, FETCHMAIL_PIDFILE);
} else {
xalloca(lockfile, char *, strlen(fmhome) + sizeof(FETCHMAIL_PIDFILE) + 2);
lockfile = (char *)xmalloc(strlen(fmhome)+sizeof(FETCHMAIL_PIDFILE)+2);
strcpy(lockfile, fmhome);
strcat(lockfile, "/");
if (fmhome == home)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment