--- smsdaemon/main.cpp 2008/06/10 15:34:19 36 +++ smsdaemon/main.cpp 2008/06/11 16:08:37 57 @@ -74,6 +74,13 @@ } } +bool sms_exit(int exitcode) +{ + if (Common::instance()->isDaemon) + daemonCleanup(); + + exit(exitcode); +} int main(int argc, char* argv[]) { @@ -115,11 +122,21 @@ catch(std::exception &e) { cmn->logMessage( string("PortOpen Exception: ") + e.what() ); - exit(1); + sms_exit(1); } GsmModem modem(port); + try + { + modem.Init(); + } + catch (std::exception& e) + { + cmn->logMessage( string("GsmModem Exception: ") + e.what() ); + sms_exit(2); + } + //////////////////////////////////