--- smsdaemon/main.cpp 2008/12/18 06:47:26 195 +++ smsdaemon/main.cpp 2008/12/18 06:53:29 196 @@ -19,8 +19,8 @@ bool sms_exit(int exitcode) { - if (Common::instance()->isDaemon) - daemonCleanup(); + if (Common::instance()->isDaemon) + daemonCleanup(); exit(exitcode); } @@ -36,13 +36,13 @@ port = new SerialPort ( config->GetValue("gsmmodem","serialport") ); try { - port->Open( SerialPort::BAUD_9600, - SerialPort::CHAR_SIZE_8, - SerialPort::PARITY_NONE, - SerialPort::STOP_BITS_1, - SerialPort::FLOW_CONTROL_HARD ); + port->Open( SerialPort::BAUD_9600, + SerialPort::CHAR_SIZE_8, + SerialPort::PARITY_NONE, + SerialPort::STOP_BITS_1, + SerialPort::FLOW_CONTROL_HARD ); } - catch(std::exception &e) + catch (std::exception &e) { Logger::logMessage( string("PortOpen Exception: ") + e.what() ); sms_exit(1); @@ -82,26 +82,27 @@ cmn->daemonStart = time(0); ConfigFile* config = cmn->GetConfigfile(); - + bool res = config->Open( cmn->configFilePath ) ; - if (!res) { + if (!res) + { cout << "Could not open config file:" << cmn->configFilePath << endl; return 1; } Logger::initLog(); - + ///////////////////// string transconf = config->GetValue("smsdaemon", "transceiver"); - - if (transconf == "internal") + + if (transconf == "internal") { openModemPort(); closeModemPort(); - } - else if ( transconf == "debug" || transconf == "smstools") + } + else if ( transconf == "debug" || transconf == "smstools") { //do nothing } @@ -111,9 +112,9 @@ exit(1); } - - if (Common::instance()->isDaemon) + + if (Common::instance()->isDaemon) { lookup_uid_values(); daemonize(); @@ -128,7 +129,7 @@ else if (transconf =="smstools") { transceiver = new SmsToolTransceiver(); - } + } else if (transconf == "debug") { transceiver = new DebugTransceiver(); @@ -138,11 +139,11 @@ SmsDaemon daemon(*transceiver); - daemon.Start(); + daemon.Start(); //returns here when main-loop exits - if (cmn->isDaemon) - daemonCleanup(); + if (cmn->isDaemon) + daemonCleanup(); if (transconf == "builtin") {