mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 18:36:17 +01:00
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:
parent
e03f83212d
commit
b6c81d139c
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
18
configure.ac
18
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
|
||||
|
@ -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];
|
||||
|
15
glib/gpoll.c
15
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;
|
||||
|
Loading…
Reference in New Issue
Block a user