Remove the old school daemon option
This commit is contained in:
15
src/main.c
15
src/main.c
@@ -1100,7 +1100,6 @@ int main (int argc, char **argv)
|
|||||||
{ "buffer-size", &buffer_size, option_long },
|
{ "buffer-size", &buffer_size, option_long },
|
||||||
{ "noquickack", NULL, option_option },
|
{ "noquickack", NULL, option_option },
|
||||||
{ "retry", &retry_opts, option_option },
|
{ "retry", &retry_opts, option_option },
|
||||||
{ "daemon", NULL, option_option },
|
|
||||||
{ "statefile", &statefile, option_str },
|
{ "statefile", &statefile, option_str },
|
||||||
{ "timeout", &user_timeout, option_long },
|
{ "timeout", &user_timeout, option_long },
|
||||||
{ "debug", NULL, option_option },
|
{ "debug", NULL, option_option },
|
||||||
@@ -1184,20 +1183,6 @@ int main (int argc, char **argv)
|
|||||||
if (gt_setup_secretkey(&ctx, keyfile))
|
if (gt_setup_secretkey(&ctx, keyfile))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (option_is_set(opts, "daemon")) {
|
|
||||||
switch (fork()) {
|
|
||||||
case -1:
|
|
||||||
perror("fork");
|
|
||||||
return 1;
|
|
||||||
case 0:
|
|
||||||
if (setsid()==-1)
|
|
||||||
perror("setsid");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state_init(statefile))
|
if (state_init(statefile))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user