]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Rename HAVE_POLL to prevent conflicting #defines
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 4 May 2017 14:24:25 +0000 (10:24 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 4 May 2017 14:24:25 +0000 (10:24 -0400)
Rename HAVE_POLL to HAVE_POLL_CALL, when compiling with
snmp and poll enabled this was causing issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
configure.ac
lib/thread.c
lib/thread.h

index 63fbc304fcee81d35bf82385f2be8c7f37a3a32d..9b4af1f2bf3cc8d4392d8b6b8d90f1960fef06d8 100755 (executable)
@@ -321,7 +321,7 @@ if test "${enable_rr_semantics}" != "no" ; then
 fi
 
 if test "${enable_poll}" = "yes" ; then
-  AC_DEFINE(HAVE_POLL,,Compile systemd support in)
+  AC_DEFINE(HAVE_POLL_CALL,,Compile systemd support in)
 fi
 
 dnl ----------
index e3db7a93e5944587d884e6623e03cb04557ab37b..e71b1cb1397acdf86875aa0f4c4f697097fab059 100644 (file)
@@ -486,7 +486,7 @@ thread_master_create (void)
   rv->timer->cmp = rv->background->cmp = thread_timer_cmp;
   rv->timer->update = rv->background->update = thread_timer_update;
 
-#if defined(HAVE_POLL)
+#if defined(HAVE_POLL_CALL)
   rv->handler.pfdsize = rv->fd_limit;
   rv->handler.pfdcount = 0;
   rv->handler.pfds = XCALLOC (MTYPE_THREAD_MASTER,
@@ -642,7 +642,7 @@ thread_master_free (struct thread_master *m)
   thread_list_free (m, &m->unuse);
   thread_queue_free (m, m->background);
 
-#if defined(HAVE_POLL)
+#if defined(HAVE_POLL_CALL)
   XFREE (MTYPE_THREAD_MASTER, m->handler.pfds);
 #endif
   XFREE (MTYPE_THREAD_MASTER, m);
@@ -705,7 +705,7 @@ thread_get (struct thread_master *m, u_char type,
   return thread;
 }
 
-#if defined (HAVE_POLL)
+#if defined (HAVE_POLL_CALL)
 
 #define fd_copy_fd_set(X) (X)
 
@@ -759,7 +759,7 @@ static int
 fd_select (struct thread_master *m, int size, thread_fd_set *read, thread_fd_set *write, thread_fd_set *except, struct timeval *timer_wait)
 {
   int num;
-#if defined(HAVE_POLL)
+#if defined(HAVE_POLL_CALL)
   /* recalc timeout for poll. Attention NULL pointer is no timeout with
   select, where with poll no timeount is -1 */
   int timeout = -1;
@@ -777,7 +777,7 @@ fd_select (struct thread_master *m, int size, thread_fd_set *read, thread_fd_set
 static int
 fd_is_set (struct thread *thread, thread_fd_set *fdset, int pos)
 {
-#if defined(HAVE_POLL)
+#if defined(HAVE_POLL_CALL)
   return 1;
 #else
   return FD_ISSET (THREAD_FD (thread), fdset);
@@ -787,7 +787,7 @@ fd_is_set (struct thread *thread, thread_fd_set *fdset, int pos)
 static int
 fd_clear_read_write (struct thread *thread)
 {
-#if !defined(HAVE_POLL)
+#if !defined(HAVE_POLL_CALL)
   thread_fd_set *fdset = NULL;
   int fd = THREAD_FD (thread);
 
@@ -812,7 +812,7 @@ funcname_thread_add_read_write (int dir, struct thread_master *m,
 {
   struct thread *thread = NULL;
 
-#if !defined(HAVE_POLL)
+#if !defined(HAVE_POLL_CALL)
   thread_fd_set *fdset = NULL;
   if (dir == THREAD_READ)
     fdset = &m->handler.readfd;
@@ -820,7 +820,7 @@ funcname_thread_add_read_write (int dir, struct thread_master *m,
     fdset = &m->handler.writefd;
 #endif
 
-#if defined (HAVE_POLL)
+#if defined (HAVE_POLL_CALL)
   thread = generic_thread_add(m, func, arg, fd, dir, debugargpass);
 
   if (thread == NULL)
@@ -969,7 +969,7 @@ funcname_thread_add_event (struct thread_master *m,
 static void
 thread_cancel_read_or_write (struct thread *thread, short int state)
 {
-#if defined(HAVE_POLL)
+#if defined(HAVE_POLL_CALL)
   nfds_t i;
 
   for (i=0;i<thread->master->handler.pfdcount;++i)
@@ -1003,7 +1003,7 @@ thread_cancel (struct thread *thread)
   switch (thread->type)
     {
     case THREAD_READ:
-#if defined (HAVE_POLL)
+#if defined (HAVE_POLL_CALL)
       thread_cancel_read_or_write (thread, POLLIN | POLLHUP);
 #else
       thread_cancel_read_or_write (thread, 0);
@@ -1011,7 +1011,7 @@ thread_cancel (struct thread *thread)
       thread_array = thread->master->read;
       break;
     case THREAD_WRITE:
-#if defined (HAVE_POLL)
+#if defined (HAVE_POLL_CALL)
       thread_cancel_read_or_write (thread, POLLOUT | POLLHUP);
 #else
       thread_cancel_read_or_write (thread, 0);
@@ -1143,7 +1143,7 @@ thread_process_fds_helper (struct thread_master *m, struct thread *thread, threa
       thread_delete_fd (thread_array, thread);
       thread_list_add (&m->ready, thread);
       thread->type = THREAD_READY;
-#if defined(HAVE_POLL)
+#if defined(HAVE_POLL_CALL)
       thread->master->handler.pfds[pos].events &= ~(state);
 #endif
       return 1;
@@ -1151,7 +1151,7 @@ thread_process_fds_helper (struct thread_master *m, struct thread *thread, threa
   return 0;
 }
 
-#if defined(HAVE_POLL)
+#if defined(HAVE_POLL_CALL)
 
 /* check poll events */
 static void
@@ -1192,7 +1192,7 @@ check_pollfds(struct thread_master *m, fd_set *readfd, int num)
 static void
 thread_process_fds (struct thread_master *m, thread_fd_set *rset, thread_fd_set *wset, int num)
 {
-#if defined (HAVE_POLL)
+#if defined (HAVE_POLL_CALL)
   check_pollfds (m, rset, num);
 #else
   int ready = 0, index;
@@ -1280,7 +1280,7 @@ thread_fetch (struct thread_master *m, struct thread *fetch)
       thread_process (&m->event);
       
       /* Structure copy.  */
-#if !defined(HAVE_POLL)
+#if !defined(HAVE_POLL_CALL)
       readfd = fd_copy_fd_set(m->handler.readfd);
       writefd = fd_copy_fd_set(m->handler.writefd);
       exceptfd = fd_copy_fd_set(m->handler.exceptfd);
index 3440a929993db912a632ece23797d5147f2d9a5a..35a11cb77ee125758158f4bf13d5dcd008bd93e6 100644 (file)
@@ -49,7 +49,7 @@ struct pqueue;
  */
 typedef fd_set thread_fd_set;
 
-#if defined(HAVE_POLL)
+#if defined(HAVE_POLL_CALL)
 #include <poll.h>
 struct fd_handler
 {