diff options
author | Timo Sirainen <cras@irssi.org> | 2000-12-05 19:43:12 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-12-05 19:43:12 +0000 |
commit | 346808789cfd3556b8caf263bdd81982d6081296 (patch) | |
tree | 225e71d34eb28c190b3384e1d83b27c7fe8f5632 /src/fe-text/irssi.c | |
parent | 4316840890b7b14b1fe05f5548f333fe0ff8ec62 (diff) | |
download | irssi-346808789cfd3556b8caf263bdd81982d6081296.zip |
net_gethostbyname_nonblock(): don't crash if net_gethosterror() returns
error message as NULL.
Initialize winsock with win32.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@966 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/irssi.c')
-rw-r--r-- | src/fe-text/irssi.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c index dd567f28..a7e91274 100644 --- a/src/fe-text/irssi.c +++ b/src/fe-text/irssi.c @@ -223,10 +223,27 @@ static void check_files(void) g_free(path); } +#ifdef WIN32 +static void winsock_init(void) +{ + WORD wVersionRequested; + WSADATA wsaData; + + wVersionRequested = MAKEWORD(2, 2); + + if (WSAStartup(wVersionRequested, &wsaData) != 0) { + printf("Error initializing winsock\n"); + exit(1); + } +} +#endif + int main(int argc, char **argv) { check_files(); - +#ifdef WIN32 + winsock_init(); +#endif #ifdef HAVE_SOCKS SOCKSinit(argv[0]); #endif |