summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <creiter@src.gnome.org>2018-05-31 13:17:12 +0200
committerChristoph Reiter <creiter@src.gnome.org>2018-05-31 13:31:55 +0200
commitb6c81d139c3981451572d69296493e844244be09 (patch)
tree3bc935a8fa01e6c24e9804c10753c5c3f1a71379
parente03f83212deb6b30d09219e0a8896ac0d02f46ec (diff)
downloadglib-b6c81d139c3981451572d69296493e844244be09.tar.gz
Remove NO_FD_SET and assume fd_set exists
gspawn.c is using fd_set without checks for 17 years now and the NO_FD_SET check was added 19 years ago.
-rw-r--r--config.h.meson3
-rw-r--r--config.h.win32.in3
-rw-r--r--configure.ac18
-rw-r--r--glib/gbacktrace.c16
-rw-r--r--glib/gpoll.c15
5 files changed, 3 insertions, 52 deletions
diff --git a/config.h.meson b/config.h.meson
index fd0bfcaf9..f134cac35 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -668,9 +668,6 @@
/* Do we cache iconv descriptors */
#mesondefine NEED_ICONV_CACHE
-/* didn't find fd_set */
-#mesondefine NO_FD_SET
-
/* Define to the address where bug reports for this package should be sent. */
#mesondefine PACKAGE_BUGREPORT
diff --git a/config.h.win32.in b/config.h.win32.in
index 14ac11d39..c8e393b2f 100644
--- a/config.h.win32.in
+++ b/config.h.win32.in
@@ -683,9 +683,6 @@
/* Do we cache iconv descriptors */
/* #undef NEED_ICONV_CACHE */
-/* didn't find fd_set */
-/* #undef NO_FD_SET */
-
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=glib"
diff --git a/configure.ac b/configure.ac
index be48c9a19..6df0dfa82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1221,24 +1221,6 @@ jm_AC_TYPE_INTMAX_T
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
AC_FUNC_SNPRINTF_C99
-# Check if <sys/select.h> needs to be included for fd_set
-AC_MSG_CHECKING([for fd_set])
-AC_TRY_COMPILE([#include <sys/types.h>],
- [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
-AS_IF([test "$gtk_ok" = "yes"], [
- AC_MSG_RESULT([yes, found in sys/types.h])
-], [
- AC_EGREP_HEADER(fd_set, sys/select.h, gtk_ok=yes)
- if test "$gtk_ok" = "yes"; then
- # *** FIXME: give it a different name
- AC_DEFINE(HAVE_SYS_SELECT_H,1,[found fd_set in sys/select.h])
- AC_MSG_RESULT([yes, found in sys/select.h])
- else
- AC_DEFINE(NO_FD_SET,1,[didn't find fd_set])
- AC_MSG_RESULT(no)
- fi
-])
-
dnl Check for nl_langinfo and CODESET
AC_LANG_SAVE
AC_LANG_C
diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c
index d29f4fad6..e83079985 100644
--- a/glib/gbacktrace.c
+++ b/glib/gbacktrace.c
@@ -68,18 +68,6 @@
#include "gprintfint.h"
#include "gutils.h"
-
-#ifndef NO_FD_SET
-# define SELECT_MASK fd_set
-#else
-# if defined(_IBMR2)
-# define SELECT_MASK void
-# else
-# define SELECT_MASK int
-# endif
-#endif
-
-
#ifndef G_OS_WIN32
static void stack_trace (const char * const *args);
#endif
@@ -274,8 +262,8 @@ stack_trace (const char * const *args)
pid_t pid;
int in_fd[2];
int out_fd[2];
- SELECT_MASK fdset;
- SELECT_MASK readset;
+ fd_set fdset;
+ fd_set readset;
struct timeval tv;
int sel, idx, state;
char buffer[256];
diff --git a/glib/gpoll.c b/glib/gpoll.c
index 01d19c048..5f46906ba 100644
--- a/glib/gpoll.c
+++ b/glib/gpoll.c
@@ -333,26 +333,13 @@ g_poll (GPollFD *fds,
#include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */
-#ifndef NO_FD_SET
-# define SELECT_MASK fd_set
-#else /* !NO_FD_SET */
-# ifndef _AIX
-typedef long fd_mask;
-# endif /* _AIX */
-# ifdef _IBMR2
-# define SELECT_MASK void
-# else /* !_IBMR2 */
-# define SELECT_MASK int
-# endif /* !_IBMR2 */
-#endif /* !NO_FD_SET */
-
gint
g_poll (GPollFD *fds,
guint nfds,
gint timeout)
{
struct timeval tv;
- SELECT_MASK rset, wset, xset;
+ fd_set rset, wset, xset;
GPollFD *f;
int ready;
int maxfd = 0;