projects
/
rxpd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
90526f4
)
reorder init sequence, daemonize after all commandline processing
author
Christian Thaeter
<ct@pipapo.org>
Tue, 16 Oct 2007 20:11:57 +0000
(22:11 +0200)
committer
Christian Thaeter
<ct@pipapo.org>
Tue, 16 Oct 2007 20:11:57 +0000
(22:11 +0200)
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index
7540e10
..
39eba2c
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-163,18
+163,6
@@
main (int argc, char** argv)
exit (EXIT_FAILURE);
}
exit (EXIT_FAILURE);
}
- for (int i = optind; i < argc; ++i)
- {
- if (!rxpd_file_load (rxpd_file_new (rxpd, argv[i])))
- {
- //rxpd_log (rxpd, LOG_ALERT, "Failed loading file '%s'\n");
- exit (EXIT_FAILURE);
- }
- }
-
- if (rxpd->daemonize && daemon(1, 0))
- rxpd_die ("Couldn't daemonize\n");
-
if (!rxpd->basedir)
{
rxpd_log (rxpd, LOG_ALERT, "Basedir not set (use -b BASEDIR)\n");
if (!rxpd->basedir)
{
rxpd_log (rxpd, LOG_ALERT, "Basedir not set (use -b BASEDIR)\n");
@@
-197,14
+185,25
@@
main (int argc, char** argv)
exit (EXIT_FAILURE);
}
}
exit (EXIT_FAILURE);
}
}
-
+
+ for (int i = optind; i < argc; ++i)
+ {
+ if (!rxpd_file_load (rxpd_file_new (rxpd, argv[i])))
+ {
+ //rxpd_log (rxpd, LOG_ALERT, "Failed loading file '%s'\n");
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ if (rxpd->daemonize && daemon(1, 0))
+ rxpd_die ("Couldn't daemonize\n");
+
LLIST_FOREACH (&rxpd->sockets, n)
{
struct rxpd_socket* socket = (struct rxpd_socket*)n;
rxpd_socket_schedule (socket);
}
LLIST_FOREACH (&rxpd->sockets, n)
{
struct rxpd_socket* socket = (struct rxpd_socket*)n;
rxpd_socket_schedule (socket);
}
-
// eventloop
event_dispatch ();
// eventloop
event_dispatch ();