1 |
#include <stdio.h> |
#include <stdio.h> |
|
#include <stdlib.h> |
|
|
#include <limits.h> |
|
2 |
#include <string.h> |
#include <string.h> |
3 |
|
#include <unistd.h> |
4 |
#include <errno.h> |
#include <errno.h> |
5 |
#include <sys/types.h> |
#include <limits.h> |
6 |
#include <signal.h> |
#include <signal.h> |
7 |
|
#include <sys/types.h> |
8 |
|
#include <sys/stat.h> |
9 |
|
#include <fcntl.h> |
10 |
|
|
11 |
|
#include "config.h" |
12 |
#include "imapfilter.h" |
#include "imapfilter.h" |
13 |
|
#include "pathnames.h" |
14 |
|
|
15 |
|
|
16 |
extern char *home; |
extern char *home; |
18 |
static char *lockfile = NULL; /* Lock file to stop new imapfilter processes. */ |
static char *lockfile = NULL; /* Lock file to stop new imapfilter processes. */ |
19 |
|
|
20 |
|
|
21 |
|
pid_t lockfile_pid(void); |
22 |
|
|
23 |
|
|
24 |
/* |
/* |
25 |
* Create lockfile with the PID of imapfilter as its contents. |
* Create lockfile with the PID of imapfilter as its contents. |
26 |
*/ |
*/ |
78 |
|
|
79 |
n = 0; |
n = 0; |
80 |
|
|
81 |
snprintf(lockf, PATH_MAX, "%s/%s", home, ".imapfilter/lock"); |
snprintf(lockf, PATH_MAX, "%s/%s", home, PATHNAME_LOCK_FILE); |
82 |
lockfile = xstrdup(lockf); |
lockfile = xstrdup(lockf); |
83 |
|
|
84 |
if (exists_file(lockfile)) { |
if (exists_file(lockfile)) { |