Commit d020106a by Michael Pastushkov

innocent fixes

parent 9087b375
...@@ -241,7 +241,7 @@ int build_tcp(void) { ...@@ -241,7 +241,7 @@ int build_tcp(void) {
int wait_connection(void) { int wait_connection(void) {
#if defined(__MINGW32__) || defined(__CYGWIN__) #if defined(__MINGW32__)
int client_addr_size; int client_addr_size;
#else #else
unsigned int client_addr_size; unsigned int client_addr_size;
...@@ -475,7 +475,7 @@ void fork_tcp() { ...@@ -475,7 +475,7 @@ void fork_tcp() {
#endif #endif
} }
void serve(void) { void serve() {
#ifdef __MINGW32__ #ifdef __MINGW32__
run(); run();
#else #else
...@@ -641,9 +641,16 @@ void check_options() { ...@@ -641,9 +641,16 @@ void check_options() {
/* Consistency checks */ /* Consistency checks */
if (options.mode == MODE_SERVER && !options.stay_alive) { if (options.mode == MODE_SERVER && !options.stay_alive) {
printf("%s: %s\n", name, "option --stay-alive is switched on with --mode=server"); printf("%s: option --stay-alive is switched on with --mode=server\n", name);
options.stay_alive = 0; options.stay_alive = 0;
} }
#ifdef __MINGW32__
if (options.fork) {
printf("%s: option --fork is switched off, Microsoft Windows is incompatible with forking\n", name);
options.fork = 0;
}
#endif
} }
...@@ -698,13 +705,6 @@ int main(int argc, char *argv[]) { ...@@ -698,13 +705,6 @@ int main(int argc, char *argv[]) {
} }
check_options(); check_options();
ret = (options.proto == SOCK_STREAM) ?
build_tcp() :
build_udp();
if (ret != 0)
exit(1);
#ifndef __MINGW32__ #ifndef __MINGW32__
signal(SIGCHLD, SIG_IGN); signal(SIGCHLD, SIG_IGN);
#endif #endif
...@@ -719,6 +719,13 @@ int main(int argc, char *argv[]) { ...@@ -719,6 +719,13 @@ int main(int argc, char *argv[]) {
printf(" fork: %s\n", options.fork ? "yes" : "no"); printf(" fork: %s\n", options.fork ? "yes" : "no");
} }
ret = (options.proto == SOCK_STREAM) ?
build_tcp() :
build_udp();
if (ret != 0)
exit(1);
do do
{ {
if (wait_connection() == 0) if (wait_connection() == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment