mirror of
https://github.com/dennypage/dpinger.git
synced 2024-05-19 06:50:01 +00:00
Fix typos
Move signal handler up
This commit is contained in:
@@ -1096,7 +1096,7 @@ main(
|
||||
|
||||
if (strlen(usocket_name) >= sizeof(uaddr.sun_path))
|
||||
{
|
||||
fatal("Unix socket name too large\n");
|
||||
fatal("socket name too large\n");
|
||||
}
|
||||
|
||||
usocket_fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||
@@ -1171,6 +1171,12 @@ main(
|
||||
(void) setsid();
|
||||
}
|
||||
|
||||
// Termination handler
|
||||
memset(&act, 0, sizeof(act));
|
||||
act.sa_handler = (void (*)(int)) term_handler;
|
||||
sigaction(SIGTERM, &act, NULL);
|
||||
sigaction(SIGINT, &act, NULL);
|
||||
|
||||
// Write pid file
|
||||
if (pidfile_name)
|
||||
{
|
||||
@@ -1184,12 +1190,6 @@ main(
|
||||
}
|
||||
}
|
||||
|
||||
// Termination handler
|
||||
memset(&act, 0, sizeof(act));
|
||||
act.sa_handler = (void (*)(int)) term_handler;
|
||||
sigaction(SIGTERM, &act, NULL);
|
||||
sigaction(SIGINT, &act, NULL);
|
||||
|
||||
// Create the array
|
||||
array_size = time_period / send_interval;
|
||||
array = calloc(array_size, sizeof(*array));
|
||||
@@ -1279,7 +1279,7 @@ main(
|
||||
if (r != 0)
|
||||
{
|
||||
perror("pthread_create");
|
||||
fatal("cannot create send thread\n");
|
||||
fatal("cannot create report thread\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1301,7 +1301,7 @@ main(
|
||||
if (r != 0)
|
||||
{
|
||||
perror("pthread_create");
|
||||
fatal("cannot create unix socket thread\n");
|
||||
fatal("cannot create usocket thread\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user