[glib: 1/2] Remove NO_FD_SET and assume fd_set exists
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] Remove NO_FD_SET and assume fd_set exists
- Date: Thu, 31 May 2018 12:43:35 +0000 (UTC)
commit b6c81d139c3981451572d69296493e844244be09
Author: Christoph Reiter <creiter src gnome org>
Date: Thu May 31 13:17:12 2018 +0200
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.
config.h.meson | 3 ---
config.h.win32.in | 3 ---
configure.ac | 18 ------------------
glib/gbacktrace.c | 16 ++--------------
glib/gpoll.c | 15 +--------------
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]