version 1.186, 2014/06/24 01:13:21 |
version 1.187, 2014/07/03 03:11:03 |
|
|
pid_t parent_pid = -1; |
pid_t parent_pid = -1; |
time_t parent_alive_interval = 0; |
time_t parent_alive_interval = 0; |
|
|
|
/* pid of process for which cleanup_socket is applicable */ |
|
pid_t cleanup_pid = 0; |
|
|
/* pathname and directory for AUTH_SOCKET */ |
/* pathname and directory for AUTH_SOCKET */ |
char socket_name[MAXPATHLEN]; |
char socket_name[MAXPATHLEN]; |
char socket_dir[MAXPATHLEN]; |
char socket_dir[MAXPATHLEN]; |
|
|
static void |
static void |
cleanup_socket(void) |
cleanup_socket(void) |
{ |
{ |
|
if (cleanup_pid != 0 && getpid() != cleanup_pid) |
|
return; |
|
debug("%s: cleanup", __func__); |
if (socket_name[0]) |
if (socket_name[0]) |
unlink(socket_name); |
unlink(socket_name); |
if (socket_dir[0]) |
if (socket_dir[0]) |
|
|
} |
} |
|
|
skip: |
skip: |
|
|
|
cleanup_pid = getpid(); |
|
|
#ifdef ENABLE_PKCS11 |
#ifdef ENABLE_PKCS11 |
pkcs11_init(0); |
pkcs11_init(0); |