summaryrefslogtreecommitdiff
path: root/server/miav_daemon.cc
diff options
context:
space:
mode:
authordeva <deva>2006-07-20 17:53:17 +0000
committerdeva <deva>2006-07-20 17:53:17 +0000
commit7d39c063ea84b9b30dbe669ac4ae641a49506836 (patch)
treeef1ead10d1736e9ad7ffe139872c86fd2ee00901 /server/miav_daemon.cc
parentc8df40b62cf30029a4acd1a57c8c54add54dda9b (diff)
Utilized the global info object.
Utilized the global info object. Utilized the global info object.
Diffstat (limited to 'server/miav_daemon.cc')
-rw-r--r--server/miav_daemon.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/server/miav_daemon.cc b/server/miav_daemon.cc
index 06c6c3e..8fc7144 100644
--- a/server/miav_daemon.cc
+++ b/server/miav_daemon.cc
@@ -3,7 +3,7 @@
* miav_daemon.cc
*
* Thu Jun 9 11:14:19 CEST 2005
- * Copyright 2005 Bent Bisballe
+ * Copyright 2005 Bent Bisballe Nyeng
* deva@aasimon.org
****************************************************************************/
@@ -47,20 +47,21 @@ int MiavDaemon::daemon_main()
MiavConfig config(ETC"/miav.conf");
MIaV::initConfig(&config);
- InfoConsole info(&config);
-
+ InfoConsole info;
+ MIaV::initInfo(&info);
+
int port = MIaV::config->readInt("server_port");
pid_t childpid; // variable to store the child's pid
signal(SIGCLD, SIG_IGN); // Ved SIGCHILD til IGNORE maa wait/waitpid ikke kaldes
// (ellers kommer der kernel-brok)
- info.info("Starting MIaV server v. %s", VERSION);
- info.info("Listening on port %d", port);
- Socket *socket = new Socket(port, &info);
+ MIaV::info->info("Starting MIaV server v. %s", VERSION);
+ MIaV::info->info("Listening on port %d", port);
+ Socket *socket = new Socket(port);
if(socket->hasError()) {
- info.error("Listening socket has errors, quitting.");
+ MIaV::info->error("Listening socket has errors, quitting.");
delete socket;
return 1;
}
@@ -69,19 +70,19 @@ int MiavDaemon::daemon_main()
Socket *csocket = new Socket(socket->slisten());
if(socket->hasError()) {
- info.error("Server socket has errors, quitting.");
+ MIaV::info->error("Server socket has errors, quitting.");
delete csocket;
break;
}
if(csocket->hasError()) {
- info.error("Child socket has errors, quitting.");
+ MIaV::info->error("Child socket has errors, quitting.");
delete csocket;
break;
}
if(!csocket->isConnected()) {
- info.error("Child socket is not connected, quitting.");
+ MIaV::info->error("Child socket is not connected, quitting.");
delete csocket;
break;
}
@@ -90,11 +91,11 @@ int MiavDaemon::daemon_main()
switch(childpid) {
case -1: // fork() returns -1 on failure
- info.log("Fork error: %s", strerror(errno));
+ MIaV::info->log("Fork error: %s", strerror(errno));
exit(1);
case 0: // fork() returns 0 to the child process
delete socket; // Close listen socket.
- newConnection(csocket, &info);
+ newConnection(csocket);
delete csocket; // Close communication socket.
exit(0);