summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ldadp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ldadp.c b/ldadp.c
index 2cfbed0..00a3f05 100644
--- a/ldadp.c
+++ b/ldadp.c
@@ -18,11 +18,17 @@ static void loadConfig(char *file);
int main(int argc, char **argv)
{
+ BOOL isdaemon = TRUE;
if (argc < 2) {
printf("Nö\n");
exit(1);
}
signal(SIGPIPE, SIG_IGN);
+ if (strcmp(argv[1], "-n") == 0 && argc > 2) {
+ isdaemon = FALSE;
+ argv++;
+ argc--;
+ }
loadConfig(argv[1]);
proxy_init();
char listen_addr[4] = {0, 0, 0, 0};
@@ -40,7 +46,7 @@ int main(int argc, char **argv)
// Init AD uplinks
server_initServers();
// Daeaeaemon
- if (daemon(1, 0) == -1) bail("daemon() failed.");
+ if (isdaemon && daemon(1, 0) == -1) bail("daemon() failed.");
// Do the mainloop
for (;;) {
if (ePoll_wait(-1) == -1) bail("ePoll wait failed.");