From: blackh <gra...@li...> - 2002-01-24 21:07:33
|
blackh Thu Jan 24 13:07:31 2002 EDT Modified files: /grapevine/cpp IOLoop.cpp Log: Would not build on Potato. Index: grapevine/cpp/IOLoop.cpp diff -u grapevine/cpp/IOLoop.cpp:1.6 grapevine/cpp/IOLoop.cpp:1.7 --- grapevine/cpp/IOLoop.cpp:1.6 Thu Jan 17 08:00:09 2002 +++ grapevine/cpp/IOLoop.cpp Thu Jan 24 13:07:28 2002 @@ -1,4 +1,4 @@ -// $Id: IOLoop.cpp,v 1.6 2002/01/17 16:00:09 blackh Exp $ +// $Id: IOLoop.cpp,v 1.7 2002/01/24 21:07:28 blackh Exp $ #include "config.h" @@ -13,6 +13,12 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> // sleep() #endif +#ifdef HAVE_SYS_TIME_H + #include <sys/time.h> // struct timeval +#endif +#ifdef HAVE_SYS_TYPES_H + #include <sys/types.h> // struct timeval +#endif #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> // inet_addr() #endif @@ -256,7 +262,9 @@ fd_set fired_writefds; memcpy(&fired_readfds, &readfds, sizeof(fired_readfds)); memcpy(&fired_writefds, &writefds, sizeof(fired_writefds)); - struct timeval onesecond = {1L, 0L}; + struct timeval onesecond; + onesecond.tv_sec = 1; + onesecond.tv_usec = 0; int ret = select(maxFD+1, &fired_readfds, &fired_writefds, NULL, &onesecond); if (ret < 0) { // If we get interrupted by a signal, then do nothing. |