X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Frnetproxy.git;a=blobdiff_plain;f=popproxy.c;h=0f01f35e9c45e7a29373888609f6592b72caf202;hp=78403ba2c05c127229cb59f530f82e208774bb10;hb=ce5509008f85738a194858108f394d12d0fe251a;hpb=8aaec8d5c79aa2bc1eae9a6ac619a30ef80e9d2e diff --git a/popproxy.c b/popproxy.c index 78403ba..0f01f35 100644 --- a/popproxy.c +++ b/popproxy.c @@ -61,11 +61,14 @@ new_client (int fd, struct sockaddr *addr, socklen_t saddr, gpointer data) } static gchar *configfile; +static gboolean foreground; static GOptionEntry opt_entries[] = { { "config-file", 'c', 0, G_OPTION_ARG_FILENAME, &configfile, "Configuration file location", "file" }, + { "foreground", 'f', 0, G_OPTION_ARG_NONE, &foreground, + "Run in foreground", 0 }, { NULL } }; @@ -152,7 +155,8 @@ int main (int argc, char **argv) g_message ("Listening at %s:%s.", conf_address, port); - daemon (0, 0); + if (!foreground) + daemon (0, 0); g_free (conf_address); g_free (port);