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.
This commit is contained in:
Christoph Reiter 2018-05-31 13:17:12 +02:00
parent e03f83212d
commit b6c81d139c
5 changed files with 3 additions and 52 deletions

View File

@ -668,9 +668,6 @@
/* Do we cache iconv descriptors */ /* Do we cache iconv descriptors */
#mesondefine NEED_ICONV_CACHE #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. */ /* Define to the address where bug reports for this package should be sent. */
#mesondefine PACKAGE_BUGREPORT #mesondefine PACKAGE_BUGREPORT

View File

@ -683,9 +683,6 @@
/* Do we cache iconv descriptors */ /* Do we cache iconv descriptors */
/* #undef NEED_ICONV_CACHE */ /* #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 to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=glib" #define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=glib"

View File

@ -1221,24 +1221,6 @@ jm_AC_TYPE_INTMAX_T
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
AC_FUNC_SNPRINTF_C99 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 dnl Check for nl_langinfo and CODESET
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_C AC_LANG_C

View File

@ -68,18 +68,6 @@
#include "gprintfint.h" #include "gprintfint.h"
#include "gutils.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 #ifndef G_OS_WIN32
static void stack_trace (const char * const *args); static void stack_trace (const char * const *args);
#endif #endif
@ -274,8 +262,8 @@ stack_trace (const char * const *args)
pid_t pid; pid_t pid;
int in_fd[2]; int in_fd[2];
int out_fd[2]; int out_fd[2];
SELECT_MASK fdset; fd_set fdset;
SELECT_MASK readset; fd_set readset;
struct timeval tv; struct timeval tv;
int sel, idx, state; int sel, idx, state;
char buffer[256]; char buffer[256];

View File

@ -333,26 +333,13 @@ g_poll (GPollFD *fds,
#include <sys/select.h> #include <sys/select.h>
#endif /* HAVE_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 gint
g_poll (GPollFD *fds, g_poll (GPollFD *fds,
guint nfds, guint nfds,
gint timeout) gint timeout)
{ {
struct timeval tv; struct timeval tv;
SELECT_MASK rset, wset, xset; fd_set rset, wset, xset;
GPollFD *f; GPollFD *f;
int ready; int ready;
int maxfd = 0; int maxfd = 0;