summaryrefslogtreecommitdiff
path: root/xhost.c
diff options
context:
space:
mode:
Diffstat (limited to 'xhost.c')
-rw-r--r--xhost.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/xhost.c b/xhost.c
index 24eec97..a5edc08 100644
--- a/xhost.c
+++ b/xhost.c
@@ -73,9 +73,6 @@ X Window System is a trademark of The Open Group.
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
-#ifdef X_NOT_POSIX
-#include <setjmp.h>
-#endif
#include <ctype.h>
#include <X11/Xauth.h>
#include <X11/Xmu/Error.h>
@@ -104,7 +101,7 @@ X Window System is a trademark of The Open Group.
#include <limits.h>
#undef _POSIX_C_SOURCE
#else
-#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)
+#ifdef _POSIX_SOURCE
#include <limits.h>
#else
#define _POSIX_SOURCE
@@ -643,9 +640,6 @@ change_host(Display *dpy, char *name, Bool add)
* be found.
*/
-#ifdef X_NOT_POSIX
-jmp_buf env;
-#endif
static const char *
get_hostname(XHostAddress *ha)
@@ -659,9 +653,7 @@ get_hostname(XHostAddress *ha)
char *kname;
static char kname_out[255];
#endif
-#ifndef X_NOT_POSIX
struct sigaction sa;
-#endif
#ifdef TCPCONN
#if defined(IPv6) && defined(AF_INET6)
@@ -698,22 +690,13 @@ get_hostname(XHostAddress *ha)
gethostbyaddr will continue after a signal, so we have to
jump out of it.
*/
-#ifndef X_NOT_POSIX
memset(&sa, 0, sizeof sa);
sa.sa_handler = nameserver_lost;
sa.sa_flags = 0; /* don't restart syscalls */
sigaction(SIGALRM, &sa, NULL);
-#else
- signal(SIGALRM, nameserver_lost);
-#endif
alarm(NAMESERVER_TIMEOUT);
-#ifdef X_NOT_POSIX
- if (setjmp(env) == 0)
-#endif
- {
- getnameinfo((struct sockaddr *) &saddr, saddrlen, inetname,
- sizeof(inetname), NULL, 0, 0);
- }
+ getnameinfo((struct sockaddr *) &saddr, saddrlen, inetname,
+ sizeof(inetname), NULL, 0, 0);
alarm(0);
if (nameserver_timedout || inetname[0] == '\0')
inet_ntop(((struct sockaddr *)&saddr)->sa_family, ha->address,
@@ -728,22 +711,12 @@ get_hostname(XHostAddress *ha)
gethostbyaddr will continue after a signal, so we have to
jump out of it.
*/
-#ifndef X_NOT_POSIX
memset(&sa, 0, sizeof sa);
sa.sa_handler = nameserver_lost;
sa.sa_flags = 0; /* don't restart syscalls */
sigaction(SIGALRM, &sa, NULL);
-#else
- signal(SIGALRM, nameserver_lost);
-#endif
alarm(4);
-#ifdef X_NOT_POSIX
- if (setjmp(env) == 0) {
-#endif
- hp = gethostbyaddr (ha->address, ha->length, AF_INET);
-#ifdef X_NOT_POSIX
- }
-#endif
+ hp = gethostbyaddr (ha->address, ha->length, AF_INET);
alarm(0);
if (hp)
return (hp->h_name);
@@ -829,11 +802,6 @@ static void
nameserver_lost(int sig)
{
nameserver_timedout = 1;
-#ifdef X_NOT_POSIX
- /* not needed with POSIX signals - stuck syscalls will not
- be restarted after signal delivery */
- longjmp(env, -1);
-#endif
}
/*