From: Hiroshi Saito Date: Wed, 6 May 2009 12:43:53 +0000 (+0000) Subject: Fixed adjustment of a WSAStartup position problem. X-Git-Tag: pgbouncer_1_3_1_rc1~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=494e82000f5f904db836ca5bad10e69f6edf9549;p=pgbouncer Fixed adjustment of a WSAStartup position problem. It happen the hostname problem in the service start. Per report Sachin Srivastava. and, thanks suggestions of Marko. --- diff --git a/win32/win32support.c b/win32/win32support.c index 27355f5..e99d51a 100644 --- a/win32/win32support.c +++ b/win32/win32support.c @@ -61,16 +61,11 @@ static void usage(int err, char *exe) static int exec_real_main(int argc, char *argv[]) { int i, j; - WSADATA wsaData; /* win32 stdio seems to be fully buffered by default */ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); - /* initialize socket subsystem */ - if (WSAStartup(MAKEWORD(2,0), &wsaData)) - fatal("Cannot start the network subsystem"); - /* check if regular arguments are in allowed list */ for (i = 1; i < argc; i++) { char *p = argv[i]; @@ -351,6 +346,12 @@ static void win32_load_config(char *conf) #undef main int main(int argc, char *argv[]) { + WSADATA wsaData; + + /* initialize socket subsystem */ + if (WSAStartup(MAKEWORD(2,0), &wsaData)) + fatal("Cannot start the network subsystem"); + /* service cmdline */ if (argc == 3) { if (!strcmp(argv[1], "-service")) {