version 1.17, 2016/01/08 10:50:26 |
version 1.18, 2016/01/08 13:09:42 |
|
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
|
|
#include <err.h> |
|
#include <errno.h> |
#include <errno.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include <poll.h> |
#include <poll.h> |
|
|
timo = -1; |
timo = -1; |
res = poll(pfds, nfds, timo); |
res = poll(pfds, nfds, timo); |
if (res < 0) { |
if (res < 0) { |
if (errno != EINTR) |
if (errno != EINTR) { |
err(1, "poll"); |
log_puts("poll failed"); |
|
panic(); |
|
} |
return 1; |
return 1; |
} |
} |
|
|
|
|
{ |
{ |
sigset_t set; |
sigset_t set; |
|
|
sigemptyset(&set); |
|
(void)sigaddset(&set, SIGPIPE); |
|
if (sigprocmask(SIG_BLOCK, &set, NULL)) |
|
err(1, "sigprocmask"); |
|
file_list = NULL; |
|
if (clock_gettime(CLOCK_MONOTONIC, &file_ts) < 0) { |
if (clock_gettime(CLOCK_MONOTONIC, &file_ts) < 0) { |
perror("clock_gettime"); |
log_puts("filelist_init: CLOCK_MONOTONIC unsupported\n"); |
exit(1); |
panic(); |
} |
} |
|
sigemptyset(&set); |
|
sigaddset(&set, SIGPIPE); |
|
sigprocmask(SIG_BLOCK, &set, NULL); |
|
file_list = NULL; |
log_sync = 0; |
log_sync = 0; |
timo_init(); |
timo_init(); |
} |
} |