| 106 |
struct sigaction act = {0}; |
struct sigaction act = {0}; |
| 107 |
int i; |
int i; |
| 108 |
int j; |
int j; |
| 109 |
|
struct stat file_stat; |
| 110 |
|
|
| 111 |
// Parse args |
// Parse args |
| 112 |
for (i = 1; i < argc; i++) |
for (i = 1; i < argc; i++) |
| 232 |
return -2; |
return -2; |
| 233 |
} |
} |
| 234 |
|
|
| 235 |
|
// Get EULA modification tm |
| 236 |
|
if (stat(DATA_EULA, &file_stat) == -1) |
| 237 |
|
{ |
| 238 |
|
log_error("stat(%s) error\n", DATA_EULA, errno); |
| 239 |
|
goto cleanup; |
| 240 |
|
} |
| 241 |
|
BBS_eula_tm = file_stat.st_mtim.tv_sec; |
| 242 |
|
|
| 243 |
// Check article cache dir |
// Check article cache dir |
| 244 |
ret = mkdir(VAR_ARTICLE_CACHE_DIR, 0750); |
ret = mkdir(VAR_ARTICLE_CACHE_DIR, 0750); |
| 245 |
if (ret == -1 && errno != EEXIST) |
if (ret == -1 && errno != EEXIST) |
| 393 |
goto cleanup; |
goto cleanup; |
| 394 |
} |
} |
| 395 |
act.sa_handler = SIG_IGN; |
act.sa_handler = SIG_IGN; |
| 396 |
|
if (sigaction(SIGPIPE, &act, NULL) == -1) |
| 397 |
|
{ |
| 398 |
|
log_error("set signal action of SIGPIPE error: %d\n", errno); |
| 399 |
|
goto cleanup; |
| 400 |
|
} |
| 401 |
|
act.sa_handler = SIG_IGN; |
| 402 |
if (sigaction(SIGUSR1, &act, NULL) == -1) |
if (sigaction(SIGUSR1, &act, NULL) == -1) |
| 403 |
{ |
{ |
| 404 |
log_error("set signal action of SIGUSR1 error: %d\n", errno); |
log_error("set signal action of SIGUSR1 error: %d\n", errno); |