comparison src/protocols/gg/libgg.c @ 2475:ba7ee4c1908c

[gaim-migrate @ 2488] BMiller's fixes so gg compiles on solaris committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 10 Oct 2001 20:03:17 +0000
parents b2926d21f067
children 04a5f68f640c
comparison
equal deleted inserted replaced
2474:19b4cd08e458 2475:ba7ee4c1908c
1 /* $Id: libgg.c 2412 2001-10-01 06:56:34Z warmenhoven $ */ 1 /* $Id: libgg.c 2488 2001-10-10 20:03:17Z warmenhoven $ */
2 2
3 /* 3 /*
4 * (C) Copyright 2001 Wojtek Kaniewski <wojtekka@irc.pl> 4 * (C) Copyright 2001 Wojtek Kaniewski <wojtekka@irc.pl>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
24 #include <sys/socket.h> 24 #include <sys/socket.h>
25 #include <netinet/in.h> 25 #include <netinet/in.h>
26 #include <arpa/inet.h> 26 #include <arpa/inet.h>
27 #include <sys/ioctl.h> 27 #include <sys/ioctl.h>
28 #include <sys/wait.h> 28 #include <sys/wait.h>
29 #include <sys/types.h>
30 #include <fcntl.h>
29 #include <netdb.h> 31 #include <netdb.h>
30 #include <errno.h> 32 #include <errno.h>
31 #include <string.h> 33 #include <string.h>
32 #include <stdarg.h> 34 #include <stdarg.h>
33 #include <pwd.h> 35 #include <pwd.h>
208 gg_debug(GG_DEBUG_MISC, "-- socket() failed. errno = %d (%s)\n", errno, strerror(errno)); 210 gg_debug(GG_DEBUG_MISC, "-- socket() failed. errno = %d (%s)\n", errno, strerror(errno));
209 return -1; 211 return -1;
210 } 212 }
211 213
212 if (async) { 214 if (async) {
215 #ifdef FIONBIO
213 if (ioctl(sock, FIONBIO, &one) == -1) { 216 if (ioctl(sock, FIONBIO, &one) == -1) {
217 #else
218 int flags = fcntl (sock, F_GETFL);
219 if (flags < 0 ||
220 fcntl (sock, F_SETFL, flags | O_NONBLOCK) < 0) {
221 #endif
214 gg_debug(GG_DEBUG_MISC, "-- ioctl() failed. errno = %d (%s)\n", errno, strerror(errno)); 222 gg_debug(GG_DEBUG_MISC, "-- ioctl() failed. errno = %d (%s)\n", errno, strerror(errno));
215 return -1; 223 return -1;
216 } 224 }
217 } 225 }
218 226