Subversion Repositories Tewi

Rev

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

Rev 90 Rev 91
Line 1... Line 1...
1
/* $Id: main.c 90 2024-09-19 13:14:38Z nishi $ */
1
/* $Id: main.c 91 2024-09-19 13:15:32Z 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
 
78
int main(int argc, char** argv) {
83
int main(int argc, char** argv) {
79
	logfile = stderr;
84
	logfile = stderr;
80
#ifdef SERVICE
85
#ifdef SERVICE
81
	SERVICE_TABLE_ENTRY table[] = {{"Tewi HTTPd", servmain}, {NULL, NULL}};
86
	SERVICE_TABLE_ENTRY table[] = {{"Tewi HTTPd", servmain}, {NULL, NULL}};
82
	StartServiceCtrlDispatcher(table);
87
	StartServiceCtrlDispatcher(table);
Line 143... Line 148...
143
	free(r);
148
	free(r);
144
#ifndef __MINGW32__
149
#ifndef __MINGW32__
145
	signal(SIGCHLD, SIG_IGN);
150
	signal(SIGCHLD, SIG_IGN);
146
	signal(SIGPIPE, SIG_IGN);
151
	signal(SIGPIPE, SIG_IGN);
147
	signal(SIGCONT, SIG_IGN);
152
	signal(SIGCONT, SIG_IGN);
-
 
153
	int i;
-
 
154
	for(i = 1; i < 32; i++) signal(i, sig);
148
#else
155
#else
149
	SetConsoleTitle(tw_server);
156
	SetConsoleTitle(tw_server);
150
#endif
157
#endif
151
	return -1;
158
	return -1;
152
}
159
}