]> jfr.im git - irc/ircd-hybrid/bopm.git/commitdiff
configure.in:
authorandy <redacted>
Thu, 14 Feb 2002 01:51:38 +0000 (01:51 +0000)
committerandy <redacted>
Thu, 14 Feb 2002 01:51:38 +0000 (01:51 +0000)
Check for sys/poll.h
options.h:
We'll use poll() if sys/poll.h was found
scan.c:
Alter for autoconfiscated sys/poll.h check.

configure
configure.in
options.h
scan.c
setup.h.in

index 83d3fd9620df981df433445c530024ed442b313d..5ec3f35f9767b823f1b645f01b3932abef2d7dfe 100755 (executable)
--- a/configure
+++ b/configure
@@ -932,7 +932,7 @@ EOF
 
 fi
 
-for ac_hdr in fcntl.h sys/time.h unistd.h
+for ac_hdr in sys/poll.h fcntl.h sys/time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
index 7ebc0a3eb7b5f2fd70c231b83f1036cb564b62ee..dbf6ed30959fb1c1448d491bd90ca7b207e6a20d 100644 (file)
@@ -10,7 +10,7 @@ dnl Checks for libraries.
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
+AC_CHECK_HEADERS(sys/poll.h fcntl.h sys/time.h unistd.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
index cdf41832c608dcb9b9b54884ff940b6b4c086f66..6c9a54af90f4568dfdaea7427c1f8739884b0a5f 100644 (file)
--- a/options.h
+++ b/options.h
@@ -23,8 +23,6 @@
 
 #undef UNREAL
 
-/* Use poll() instead of select() */
-#define USE_POLL
 #define MAX_POLL 1024
 
 /* Client buffer size for scan 
diff --git a/scan.c b/scan.c
index a7a23b1299bc4b0ac98446ab2bbe592b2200898d..46fab89cb83b2b8d49985fe797a108c1423afd1e 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -49,7 +49,10 @@ along with this program; if not, write to the Free Software
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sys/poll.h>
+
+#ifdef HAVE_SYS_POLL_H
+# include <sys/poll.h>
+#endif
 
 #include "config.h"
 #include "irc.h"
@@ -244,7 +247,7 @@ void scan_cycle()
 void scan_check()
 {
 
-#ifdef USE_POLL
+#ifdef HAVE_SYS_POLL_H
     static struct pollfd ufds[MAX_POLL];  /* MAX_POLL is defined in options.h */
     int i;
     unsigned long size;
@@ -253,7 +256,7 @@ void scan_check()
     fd_set r_fdset;
     struct timeval scan_timeout;
     int highfd = 0;
-#endif /* USE_POLL */
+#endif /* HAVE_SYS_POLL_H */
 
     struct scan_struct *ss;
   
@@ -261,7 +264,7 @@ void scan_check()
        return;
 
 
-#ifdef USE_POLL
+#ifdef HAVE_SYS_POLL_H
 
     size = 0;
 
@@ -329,14 +332,14 @@ void scan_check()
     scan_timeout.tv_sec      = 0;  /* No timeout */
     scan_timeout.tv_usec     = 0;
 
-#endif /* USE_POLL */
+#endif /* HAVE_SYS_POLL_H */
 
 
-#ifdef USE_POLL
+#ifdef HAVE_SYS_POLL_H
     switch(poll(ufds, size, 0))
 #else /* select() */
     switch(select((highfd + 1), &r_fdset, &w_fdset, 0, &scan_timeout)) 
-#endif /* USE_POLL */
+#endif /* HAVE_SYS_POLL_H */
      {
 
         case -1:
@@ -346,7 +349,7 @@ void scan_check()
                         /* Pass pointer to connection to handler */
         default:
 
-#ifdef USE_POLL
+#ifdef HAVE_SYS_POLL_H
              for(ss = CONNECTIONS; ss; ss = ss->next)
               {
                  for(i = 0; i < size; i++)
@@ -376,7 +379,7 @@ void scan_check()
                  if(FD_ISSET(ss->fd, &w_fdset))
                    scan_writeready(ss);                                         
                }               
-#endif /* USE_POLL */
+#endif /* HAVE_SYS_POLL_H */
                         
      }               
      
index ba9831176e3992e65cddd015d7f150fb1210d91d..8e8733a89271fe898962157a172c72dd3a5dd3c8 100644 (file)
@@ -40,6 +40,9 @@
 /* Define if you have the <fcntl.h> header file.  */
 #undef HAVE_FCNTL_H
 
+/* Define if you have the <sys/poll.h> header file.  */
+#undef HAVE_SYS_POLL_H
+
 /* Define if you have the <sys/time.h> header file.  */
 #undef HAVE_SYS_TIME_H