aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2008-08-07 10:32:11 -0400
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-11-02 19:46:36 +0100
commite5b4532ab8576dd0927e3f549a1546fb3b37d8e1 (patch)
tree63785e389e767927e55ea9b6a935beaaf570fbec /nx-X11/lib
parent0ca6e59996078472a3e3464e97232ce650893a29 (diff)
downloadnx-libs-e5b4532ab8576dd0927e3f549a1546fb3b37d8e1.tar.gz
nx-libs-e5b4532ab8576dd0927e3f549a1546fb3b37d8e1.tar.bz2
nx-libs-e5b4532ab8576dd0927e3f549a1546fb3b37d8e1.zip
Drastically simplify TRANS_OPEN_MAX.
If your OS doesn't have sysconf(3), then life is already hard for you. Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/xtrans/Xtransint.h53
-rw-r--r--nx-X11/lib/xtrans/Xtranssock.c4
2 files changed, 3 insertions, 54 deletions
diff --git a/nx-X11/lib/xtrans/Xtransint.h b/nx-X11/lib/xtrans/Xtransint.h
index 203e5fabe..19cd86062 100644
--- a/nx-X11/lib/xtrans/Xtransint.h
+++ b/nx-X11/lib/xtrans/Xtransint.h
@@ -103,59 +103,6 @@ from The Open Group.
# include <sys/utsname.h>
# endif
-/*
- * makedepend screws up on #undef OPEN_MAX, so we define a new symbol
- */
-
-# ifndef TRANS_OPEN_MAX
-
-# ifndef X_NOT_POSIX
-# ifdef _POSIX_SOURCE
-# include <limits.h>
-# else
-# define _POSIX_SOURCE
-# include <limits.h>
-# undef _POSIX_SOURCE
-# endif
-# endif
-# ifndef OPEN_MAX
-# if defined(_SC_OPEN_MAX) && !defined(__UNIXOS2__)
-# define OPEN_MAX (sysconf(_SC_OPEN_MAX))
-# else
-# ifdef SVR4
-# define OPEN_MAX 256
-# else
-# include <sys/param.h>
-# ifndef OPEN_MAX
-# ifdef __OSF1__
-# define OPEN_MAX 256
-# else
-# ifdef NOFILE
-# define OPEN_MAX NOFILE
-# else
-# if !defined(__UNIXOS2__)
-# define OPEN_MAX NOFILES_MAX
-# else
-# define OPEN_MAX 256
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-# if defined(_SC_OPEN_MAX)
-# define TRANS_OPEN_MAX OPEN_MAX
-# else /* !__GNU__ */
-# if OPEN_MAX > 256
-# define TRANS_OPEN_MAX 256
-# else
-# define TRANS_OPEN_MAX OPEN_MAX
-# endif
-# endif /*__GNU__*/
-
-# endif /* TRANS_OPEN_MAX */
-
# define ESET(val) errno = val
# define EGET() errno
diff --git a/nx-X11/lib/xtrans/Xtranssock.c b/nx-X11/lib/xtrans/Xtranssock.c
index 3e4896fce..cdc421a1e 100644
--- a/nx-X11/lib/xtrans/Xtranssock.c
+++ b/nx-X11/lib/xtrans/Xtranssock.c
@@ -141,6 +141,8 @@ from the copyright holders.
#include <sys/stropts.h>
#endif
+#include <unistd.h>
+
#else /* !WIN32 */
#include <nx-X11/Xwinsock.h>
@@ -993,7 +995,7 @@ TRANS(SocketOpen) (int i, int type)
Sockettrans2devtab[i].protocol)) < 0
#ifndef WIN32
#if (defined(X11_t) && !defined(USE_POLL)) || defined(FS_t) || defined(FONT_t)
- || ciptr->fd >= TRANS_OPEN_MAX
+ || ciptr->fd >= sysconf(_SC_OPEN_MAX)
#endif
#endif
) {