nDPIsrvd sighandler and cmd opt parser

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2020-08-06 00:50:02 +02:00
parent 6031b07eb4
commit 5a7b0499ed
3 changed files with 111 additions and 20 deletions

View File

@@ -28,6 +28,7 @@ static int is_daemon_running(char const * const pidfile, pid_str ps)
if (read(pfd, ps, sizeof(pid_str)) <= 0)
{
close(pfd);
return 1;
}
@@ -71,7 +72,7 @@ static int create_pidfile(char const * const pidfile)
int daemonize_with_pidfile(char const * const pidfile)
{
pid_str ps;
pid_str ps = {};
if (daemonize != 0)
{