Use POSIX-specified <poll.h> over <sys/poll.h>

POSIX specifies that <poll.h> is the correct header to include for
poll(), so let's do that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=141251
This commit is contained in:
Ryan Lortie 2013-12-22 11:33:07 -05:00
parent eeac91f866
commit 3f41e49285
6 changed files with 7 additions and 24 deletions

View File

@ -584,9 +584,6 @@
/* #undef HAVE_SYS_PARAM_H */
#endif /* _MSC_VER or __DMC__ */
/* Define to 1 if you have the <sys/poll.h> header file. */
/* #undef HAVE_SYS_POLL_H */
/* Define to 1 if you have the <sys/prctl.h> header file. */
/* #undef HAVE_SYS_PRCTL_H */

View File

@ -771,7 +771,7 @@ fi
# check for header files
AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/resource.h])
AC_CHECK_HEADERS([sys/param.h sys/resource.h])
AC_CHECK_HEADERS([sys/select.h stdint.h inttypes.h sched.h malloc.h])
AC_CHECK_HEADERS([sys/vfs.h sys/vmount.h sys/statfs.h sys/statvfs.h sys/filio.h])
AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/vfstab.h sys/mntctl.h fstab.h])
@ -2429,11 +2429,11 @@ dnl ****************************************
glib_poll_includes=["
#include <sys/types.h>
#include <sys/poll.h>
#include <poll.h>
"]
AS_IF([ test $ac_cv_header_sys_types_h = yes &&
test $ac_cv_header_sys_poll_h = yes ], [
test $ac_cv_func_poll = yes ], [
glib_failed=false
GLIB_CHECK_VALUE(POLLIN, $glib_poll_includes, glib_failed=true)
GLIB_CHECK_VALUE(POLLOUT, $glib_poll_includes, glib_failed=true)
@ -2458,9 +2458,6 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
#include <fcntl.h>
#include <poll.h>
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif
int main(void) {
struct pollfd fds[1];
int fd;
@ -2803,9 +2800,6 @@ _______EOF
if test "$glib_header_alloca_h" = "yes"; then
echo '#define GLIB_HAVE_ALLOCA_H' >> $outfile
fi
if test x$glib_sys_poll_h = xyes; then
echo '#define GLIB_HAVE_SYS_POLL_H' >> $outfile
fi
if test x$glib_included_printf != xyes; then
echo "
/* Specifies that GLib's g_print*() functions wrap the
@ -3124,10 +3118,6 @@ else
glib_header_alloca_h="$ac_cv_header_alloca_h"
fi
if test x$ac_cv_header_sys_poll_h = xyes ; then
glib_sys_poll_h=yes
fi
if test x$enable_included_printf = xyes ; then
glib_included_printf=yes
fi

View File

@ -544,7 +544,6 @@ g_source_remove_by_funcs_user_data
g_source_remove_by_user_data
<SUBSECTION Private>
GLIB_HAVE_SYS_POLL_H
GLIB_HAVE_ALLOCA_H
alloca
GLIB_USING_SYSTEM_PRINTF

View File

@ -31,11 +31,8 @@
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif
#endif
#ifdef HAVE_POLL_H
#ifdef HAVE_POLL
#include <poll.h>
#endif
#include <stdio.h>

View File

@ -55,8 +55,8 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#ifdef GLIB_HAVE_SYS_POLL_H
# include <sys/poll.h>
#ifdef HAVE_POLL
# include <poll.h>
/* The poll() emulation on OS/X doesn't handle fds=NULL, nfds=0,
* so we prefer our own poll emulation.

View File

@ -8,7 +8,7 @@
#include <unistd.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <sys/poll.h>
#include <poll.h>
#define TRUE 1
#define FALSE 0