* lib/poll.c: Include sys/time.h and time.h unconditionally,
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Jan 2007 08:32:33 +0000 (08:32 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Jan 2007 08:32:33 +0000 (08:32 +0000)
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.

ChangeLog
lib/poll.c
m4/poll.m4
modules/poll

index 4b32b18..f0bae7e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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>.
index cda022c..2278aa8 100644 (file)
 #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)
@@ -157,7 +149,7 @@ poll (pfd, nfd, timeout)
        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
@@ -172,27 +164,27 @@ poll (pfd, nfd, timeout)
 #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;
index eb8806e..bb610da 100644 (file)
@@ -1,5 +1,5 @@
-# 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.
@@ -67,6 +67,5 @@ This is MacOSX or AIX
 # 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)
 ])
index 23da683..0330415 100644 (file)
@@ -8,6 +8,7 @@ m4/poll.m4
 
 Depends-on:
 sys_select
+sys_time
 
 configure.ac:
 gl_FUNC_POLL