since we now assume the sys_time module.
* m4/poll.m4 (gl_PREREQ_POLL): Don't require AC_HEADER_TIME or
check for sys/time.h; no longer needed.
* modules/poll (Depends-on): Depend on sys_time.
+2007-01-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/poll.c: Include sys/time.h and time.h unconditionally,
+ since we now assume the sys_time module.
+ * m4/poll.m4 (gl_PREREQ_POLL): Don't require AC_HEADER_TIME or
+ check for sys/time.h; no longer needed.
+ * modules/poll (Depends-on): Depend on sys_time.
+
2007-01-18 Bruno Haible <bruno@clisp.org>
* m4/mktime.m4 (AC_FUNC_MKTIME): Remove test for <sys/time.h>.
#include <sys/filio.h>
#endif
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
+#include <sys/time.h>
+#include <time.h>
#ifndef INFTIM
#define INFTIM (-1)
if (FD_ISSET (pfd[i].fd, &rfds))
{
int r;
-
+
#if defined __MACH__ && defined __APPLE__
/* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
for some kinds of descriptors. Detect if this descriptor is a
#endif
if (r == 0)
happened |= POLLHUP;
-
+
/* If the event happened on an unconnected server socket,
that's fine. */
else if (r > 0 || ( /* (r == -1) && */ errno == ENOTCONN))
happened |= (POLLIN | POLLRDNORM) & sought;
-
+
/* Distinguish hung-up sockets from other errors. */
else if (errno == ESHUTDOWN || errno == ECONNRESET
|| errno == ECONNABORTED || errno == ENETRESET)
happened |= POLLHUP;
-
+
else
happened |= POLLERR;
}
-
+
if (FD_ISSET (pfd[i].fd, &wfds))
happened |= (POLLOUT | POLLWRNORM | POLLWRBAND) & sought;
-
+
if (FD_ISSET (pfd[i].fd, &efds))
happened |= (POLLPRI | POLLRDBAND) & sought;
-
+
if (happened)
{
pfd[i].revents = happened;
-# poll.m4 serial 6
-dnl Copyright (c) 2003, 2005, 2006 Free Software Foundation, Inc.
+# poll.m4 serial 7
+dnl Copyright (c) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Prerequisites of lib/poll.c.
AC_DEFUN([gl_PREREQ_POLL],
[
- AC_REQUIRE([AC_HEADER_TIME])
- AC_CHECK_HEADERS_ONCE(sys/time.h sys/ioctl.h sys/filio.h)
+ AC_CHECK_HEADERS_ONCE(sys/ioctl.h sys/filio.h)
])
Depends-on:
sys_select
+sys_time
configure.ac:
gl_FUNC_POLL