Revision: 41612
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41612&view=rev
Author:   davidloman
Date:     2010-12-15 14:18:35 +0000 (Wed, 15 Dec 2010)

Log Message:
-----------
Rename expected config file in code.

Modified Paths:
--------------
    rt^3/trunk/src/GS/geoserv.cxx

Modified: rt^3/trunk/src/GS/geoserv.cxx
===================================================================
--- rt^3/trunk/src/GS/geoserv.cxx       2010-12-15 13:41:10 UTC (rev 41611)
+++ rt^3/trunk/src/GS/geoserv.cxx       2010-12-15 14:18:35 UTC (rev 41612)
@@ -34,6 +34,18 @@
 
 #include <QtCore/QString>
 
+int gsExit(int code)
+{
+       Logger* log = Logger::getInstance();
+    log->logBANNER("geoserv", "GeometryService is Shutting Down...");
+
+       JobManager::getInstance()->shutdown(true);
+
+       log->logINFO("geoserv", "Exiting.");
+       usleep(1000); /* Yeild main thread, let other threads finish unlocking 
*/
+       exit(code);
+}
+
 int main(int argc, char* argv[])
 {
     std::cout << std::endl << std::endl;
@@ -46,10 +58,10 @@
 
     Config* c = Config::getInstance();
 
-    //TODO Configure system loads stuff here
-    if (c->loadFile("geoserve.config", true) == false) {
+    //TODO Configure system loads stuff here, could be prettier
+    if (c->loadFile("geoserv.config", true) == false) {
        log->logERROR("geoserv","Failed to properly Load config File.  
Exiting.");
-       return 1;
+       gsExit(1);
     }
 
     QString localNodename = c->getConfigValue("LocalNodeName");
@@ -62,11 +74,11 @@
     QString sport = c->getConfigValue("ListenPort");
     if (sport == NULL){
        log->logERROR("geoserv", "Config File does not contain a 'ListenPort' 
parameter");
-       return 1;
+       gsExit(1);
     }
     if (sport.length() <= 0){
-       log->logERROR("geoserv", "Config File contains a 'ListenPort' key, 
however the value was <= 0.");
-       return 1;
+       log->logERROR("geoserv", "Config File contains a 'ListenPort' key, 
however the value length was <= 0.");
+       gsExit(1);
     }
 
     bool ok;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to