Changeset 70 in Main for trunk/Server/main.c
- Timestamp:
- Sep 19, 2024, 6:23:45 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/main.c
r62 r70 37 37 SERVICE_STATUS_HANDLE status_handle; 38 38 39 void WINAPI servhandler(DWORD control) {40 switch(control) {41 42 43 44 39 void WINAPI servhandler(DWORD control) { 40 switch(control) { 41 case SERVICE_CONTROL_STOP: 42 case SERVICE_CONTROL_SHUTDOWN: 43 status.dwCurrentState = SERVICE_STOP_PENDING; 44 break; 45 45 } 46 46 SetServiceStatus(status_handle, &status); 47 47 } 48 48 49 void WINAPI servmain(DWORD argc, LPSTR* argv) {49 void WINAPI servmain(DWORD argc, LPSTR* argv) { 50 50 logfile = fopen(PREFIX "/logs/tewi.log", "a"); 51 51 if(logfile == NULL) logfile = stderr; … … 61 61 if(SetServiceStatus(status_handle, &status) == 0) return; 62 62 int st = startup(argc, argv); 63 if(st != -1) {63 if(st != -1) { 64 64 status.dwWin32ExitCode = NO_ERROR; 65 65 status.dwServiceSpecificExitCode = st; … … 88 88 } 89 89 90 int startup(int argc, char** argv) {90 int startup(int argc, char** argv) { 91 91 int i; 92 92 const char* confpath = PREFIX "/etc/tewi.conf"; 93 if(argv != NULL) {93 if(argv != NULL) { 94 94 for(i = 1; i < argc; i++) { 95 95 if(argv[i][0] == '-') { … … 97 97 if(!cm_do_log) { 98 98 cm_do_log = true; 99 99 #ifndef NO_SSL 100 100 cm_log("", "This is Tewi HTTPd, version %s, using %s", tw_get_version(), OPENSSL_VERSION_TEXT); 101 101 #else 102 102 cm_log("", "This is Tewi HTTPd, version %s", tw_get_version()); 103 103 #endif 104 104 } else { 105 105 cm_do_log = true;
Note:
See TracChangeset
for help on using the changeset viewer.