make daemonizing the last step in command processing

Bu işleme şunda yer alıyor:
Albert S. 2020-08-07 23:15:40 +02:00
ebeveyn 6b1356b65b
işleme 0e75740630
1 değiştirilmiş dosya ile 10 ekleme ve 9 silme

Dosyayı Görüntüle

@ -555,14 +555,6 @@ void process_options()
{ {
queue_watches_from_stdin(); queue_watches_from_stdin();
} }
if(daemonize)
{
if(daemon(0,0) == -1)
{
perror("daemon");
exit(EXIT_FAILURE);
}
}
if(watchlist_head == NULL) if(watchlist_head == NULL)
{ {
@ -590,6 +582,15 @@ void process_options()
char *path_prog = xrealpath(prog, NULL); char *path_prog = xrealpath(prog, NULL);
check_forkbomb(path_logfile, path_prog); check_forkbomb(path_logfile, path_prog);
} }
if(daemonize)
{
if(daemon(0,0) == -1)
{
perror("daemon");
exit(EXIT_FAILURE);
}
}
} }
void start_monitoring(int ifd) void start_monitoring(int ifd)