Librearia di log
This commit is contained in:
13
src/server.c
13
src/server.c
@ -54,7 +54,7 @@ static void checkargs(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
// TODO read config file
|
||||
// read config file
|
||||
checkargs(argc, argv);
|
||||
ini_t *config = ini_load(argv[1]);
|
||||
int threadsInPool; CONFGETINT(threadsInPool, config, "threadpool", "quantity", NULL, 10);
|
||||
@ -64,12 +64,10 @@ int main(int argc, char *argv[]) {
|
||||
ini_free(config);
|
||||
|
||||
sigset_t mask;
|
||||
sigemptyset(&mask);
|
||||
sigaddset(&mask, SIGINT);
|
||||
sigaddset(&mask, SIGQUIT);
|
||||
sigaddset(&mask, SIGTERM);
|
||||
sigfillset(&mask);
|
||||
sigdelset(&mask, SIGPIPE); // tolgo soltanto la sigpipe
|
||||
|
||||
if (pthread_sigmask(SIG_BLOCK, &mask, NULL) != 0) {
|
||||
if (pthread_sigmask(SIG_SETMASK, &mask, NULL) != 0) {
|
||||
fprintf(stderr, "ERROR setting mask\n");
|
||||
goto _cleanup;
|
||||
}
|
||||
@ -83,6 +81,9 @@ int main(int argc, char *argv[]) {
|
||||
goto _cleanup;
|
||||
}
|
||||
|
||||
// remove("mysock"); maybe necessary???
|
||||
|
||||
|
||||
printf("File Server ready.");
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user