Clean up poll() vs select() tests
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 4 Jan 2010 15:15:26 +0000 (17:15 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 4 Jan 2010 15:15:26 +0000 (17:15 +0200)
- move the includes out of system.h, not commonly needed
- <poll.h> is conditional as we actually provide a fallback through select(),
  but for <sys/select.h> missing there's no fallback so doesn't make
  much sense to test for (and both poll.h and sys/select.h are posix anyway...)

build/rpmfc.c
configure.ac
rpmio/rpmio.c
system.h

index ac19e82..d948fc8 100644 (file)
@@ -1,5 +1,6 @@
 #include "system.h"
 
+#include <sys/select.h>
 #include <signal.h>
 #include <magic.h>
 
index 4305d3c..c0d3416 100644 (file)
@@ -360,7 +360,7 @@ AC_CHECK_HEADERS(locale.h)
 AC_CHECK_HEADERS(limits.h)
 AC_CHECK_HEADERS(fcntl.h getopt.h memory.h netdb.h)
 
-AC_CHECK_HEADERS(sys/ipc.h sys/select.h)
+AC_CHECK_HEADERS(sys/ipc.h)
 AC_CHECK_HEADERS(sys/mman.h sys/utsname.h sys/wait.h)
 
 AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h)
index 6473d55..6adb12c 100644 (file)
@@ -5,6 +5,12 @@
 #include "system.h"
 #include <stdarg.h>
 
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#else
+#include <sys/select.h>
+#endif
+
 #if HAVE_LIBIO_H && defined(_G_IO_IO_FILE_VERSION)
 #define        _USE_LIBIO      1
 #endif
index 890697e..a5a2558 100644 (file)
--- a/system.h
+++ b/system.h
@@ -252,14 +252,6 @@ extern const char *__progname;
 #include <strings.h>
 #endif
 
-#if HAVE_POLL_H
-#include <poll.h>
-#else
-#if HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#endif
-
 #if HAVE_GETMNTINFO || HAVE_GETMNTINFO_R || HAVE_MNTCTL
 # define GETMNTENT_ONE 0
 # define GETMNTENT_TWO 0