changeset 7908:d41d48e822b4

* 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.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 20 Jan 2007 08:32:33 +0000
parents 1be30ef548f5
children 23cd146c58fd
files ChangeLog lib/poll.c m4/poll.m4 modules/poll
diffstat 4 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- 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>.
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -36,16 +36,8 @@
 #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 @@
 	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 @@
 #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;
--- a/m4/poll.m4
+++ b/m4/poll.m4
@@ -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 @@
 # 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)
 ])
--- a/modules/poll
+++ b/modules/poll
@@ -8,6 +8,7 @@
 
 Depends-on:
 sys_select
+sys_time
 
 configure.ac:
 gl_FUNC_POLL