Subversion Repositories Tewi

Rev

Rev 92 | Rev 94 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 92 Rev 93
Line 1... Line 1...
1
/* $Id: main.c 92 2024-09-19 13:15:48Z nishi $ */
1
/* $Id: main.c 93 2024-09-19 13:16:28Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
Line 73... Line 73...
73
	status.dwCurrentState = SERVICE_STOPPED;
73
	status.dwCurrentState = SERVICE_STOPPED;
74
	SetServiceStatus(status_handle, &status);
74
	SetServiceStatus(status_handle, &status);
75
}
75
}
76
#endif
76
#endif
77
 
77
 
78
void sig(int sign){
-
 
79
	printf("%d\n", sign);
-
 
80
	exit(0);
-
 
81
}
-
 
82
 
-
 
83
int main(int argc, char** argv) {
78
int main(int argc, char** argv) {
84
	logfile = stderr;
79
	logfile = stderr;
85
#ifdef SERVICE
80
#ifdef SERVICE
86
	SERVICE_TABLE_ENTRY table[] = {{"Tewi HTTPd", servmain}, {NULL, NULL}};
81
	SERVICE_TABLE_ENTRY table[] = {{"Tewi HTTPd", servmain}, {NULL, NULL}};
87
	StartServiceCtrlDispatcher(table);
82
	StartServiceCtrlDispatcher(table);
Line 147... Line 142...
147
	cm_force_log(r);
142
	cm_force_log(r);
148
	free(r);
143
	free(r);
149
#ifndef __MINGW32__
144
#ifndef __MINGW32__
150
	signal(SIGCHLD, SIG_IGN);
145
	signal(SIGCHLD, SIG_IGN);
151
	signal(SIGPIPE, SIG_IGN);
146
	signal(SIGPIPE, SIG_IGN);
152
	signal(SIGCONT, SIG_IGN);
147
	signal(SIGTRAP, SIG_IGN);
153
	for(i = 1; i < 32; i++) signal(i, sig);
-
 
154
#else
148
#else
155
	SetConsoleTitle(tw_server);
149
	SetConsoleTitle(tw_server);
156
#endif
150
#endif
157
	return -1;
151
	return -1;
158
}
152
}