Changeset 1741

Show
Ignore:
Timestamp:
26/07/2007 22:35:52 (18 months ago)
Author:
chris
Message:

Add a new -F option for daemons, which runs in the foreground but still
accepts multiple connections, unlike -D or SINGLEPROCESS. (refs #3,
merges [1707])

Location:
box/chris/general/lib/server
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • box/chris/general/lib/server/Daemon.cpp

    r1735 r1741  
    5454          mTerminateWanted(false), 
    5555          mSingleProcess(false), 
     56          mRunInForeground(false), 
    5657          mKeepConsoleOpenAfterFork(false) 
    5758{ 
     
    122123        #endif 
    123124 
    124         while((c = getopt(argc, (char * const *)argv, "c:DqvVt:Tk")) != -1) 
     125        while((c = getopt(argc, (char * const *)argv, "c:DFqvVt:Tk")) != -1) 
    125126        { 
    126127                switch(c) 
     
    136137                        { 
    137138                                mSingleProcess = true; 
     139                        } 
     140                        break; 
     141 
     142                        case 'F': 
     143                        { 
     144                                mRunInForeground = true; 
    138145                        } 
    139146                        break; 
     
    251258        mConfigFileName = rConfigFileName; 
    252259         
    253         bool asDaemon   = !mSingleProcess; 
     260        bool asDaemon   = !mSingleProcess && !mRunInForeground; 
    254261 
    255262        try 
  • box/chris/general/lib/server/Daemon.h

    r1603 r1741  
    8080        bool mTerminateWanted; 
    8181        bool mSingleProcess; 
     82        bool mRunInForeground; 
    8283        bool mKeepConsoleOpenAfterFork; 
    8384        static Daemon *spDaemon;