From c151beed2a9209b5ee858ba72354c93da655b79a Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Thu, 4 Jun 2009 11:05:03 -0300 Subject: [PATCH] Only daemonize right before running loop. If we daemonize prematurely, the user may not see messages produced by the options parser, for example. Now, --help works as intended. --- improxy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/improxy.c b/improxy.c index cafc365..b13c49a 100644 --- a/improxy.c +++ b/improxy.c @@ -1,5 +1,6 @@ /* ** Copyright (C) 2006 Thadeu Lima de Souza Cascardo +** Copyright (C) 2009 Thadeu Lima de Souza Cascardo ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -58,8 +59,6 @@ int main (int argc, char** argv) gchar* conf_address; gint port; - daemon (0, 0); - gnet_init (); im_log_init (); @@ -85,6 +84,8 @@ int main (int argc, char** argv) inetaddr = gnet_inetaddr_new_nonblock (conf_address, port); gnet_server_new (inetaddr, port, new_client, NULL); + daemon (0, 0); + g_main_loop_run (g_main_loop_new (g_main_context_default (), TRUE)); return 0; -- 2.20.1