Bye Bye fake mode
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -668,11 +668,6 @@ int main (int argc, char **argv)
|
|||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
struct option daemon_opts[] = {
|
|
||||||
{ "fake", NULL, option_option },
|
|
||||||
{ NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
struct option retry_opts[] = {
|
struct option retry_opts[] = {
|
||||||
{ "count", &retry_count, option_long },
|
{ "count", &retry_count, option_long },
|
||||||
{ "slope", &retry_slope, option_long },
|
{ "slope", &retry_slope, option_long },
|
||||||
@@ -694,7 +689,7 @@ 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", &daemon_opts, option_option },
|
{ "daemon", NULL, option_option },
|
||||||
{ "version", NULL, option_option },
|
{ "version", NULL, option_option },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
@@ -776,15 +771,14 @@ int main (int argc, char **argv)
|
|||||||
perror("fork");
|
perror("fork");
|
||||||
return 1;
|
return 1;
|
||||||
case 0:
|
case 0:
|
||||||
if (option_is_set(daemon_opts, "fake")) {
|
if (setsid()==-1)
|
||||||
gt_log("running in fake daemon mode\n");
|
|
||||||
} else if (setsid()==-1) {
|
|
||||||
perror("setsid");
|
perror("setsid");
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
chdir("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
long retry = 0;
|
long retry = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user