Changeset 2211
- Timestamp:
- 03/08/2008 08:02:04 (5 months ago)
- Files:
-
- 1 modified
-
box/trunk/lib/server/Daemon.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/server/Daemon.cpp
r2177 r2211 108 108 { 109 109 return "c:" 110 #ifdef WIN32 111 "K" 112 #else // !WIN32 113 "DFkP" 110 #ifndef WIN32 111 "DFP" 114 112 #endif 115 "h qt:TUvVW:";113 "hkKqt:TUvVW:"; 116 114 } 117 115 … … 127 125 " argument is the configuration file, or else the default \n" 128 126 " [" << GetConfigFileName() << "]\n" 129 #ifdef WIN32 130 " -K Stop writing log messages to console while daemon is running\n" 131 #else // !WIN32 127 #ifndef WIN32 132 128 " -D Debugging mode, do not fork, one process only, one client only\n" 133 129 " -F Do not fork into background, but fork to serve multiple clients\n" 130 #endif 134 131 " -k Keep console open after fork, keep writing log messages to it\n" 132 " -K Stop writing log messages to console while daemon is running\n" 133 #ifndef WIN32 135 134 " -P Show process ID (PID) in console output\n" 136 135 #endif … … 166 165 break; 167 166 168 #ifdef WIN32 167 #ifndef WIN32 168 case 'D': 169 { 170 mSingleProcess = true; 171 } 172 break; 173 174 case 'F': 175 { 176 mRunInForeground = true; 177 } 178 break; 179 #endif // !WIN32 180 181 case 'k': 182 { 183 mKeepConsoleOpenAfterFork = true; 184 } 185 break; 186 169 187 case 'K': 170 188 { … … 172 190 } 173 191 break; 174 #else // !WIN32175 case 'D':176 {177 mSingleProcess = true;178 }179 break;180 181 case 'F':182 {183 mRunInForeground = true;184 }185 break;186 187 case 'k':188 {189 mKeepConsoleOpenAfterFork = true;190 }191 break;192 #endif193 192 194 193 case 'h': … … 199 198 break; 200 199 201 #ifndef WIN32202 200 case 'P': 203 201 { … … 205 203 } 206 204 break; 207 #endif208 205 209 206 case 'q': … … 436 433 std::string pidFileName; 437 434 438 bool asDaemon = !mSingleProcess && !mRunInForeground; 435 #ifndef WIN32 436 bool asDaemon = !mSingleProcess && !mRunInForeground; 437 #endif 439 438 440 439 try … … 542 541 char pid[32]; 543 542 544 #ifdef WIN32545 int pidsize = sprintf(pid, "%d", (int)GetCurrentProcessId());546 #else547 543 int pidsize = sprintf(pid, "%d", (int)getpid()); 548 #endif549 544 550 545 if(::write(pidFile, pid, pidsize) != pidsize)
