wdvi

network DVI viewer
Log | Files | Refs

commit e264347d6359b1af95166083f913b4897d41c2a6
parent a4cd1c832b934e75a93dd701b2b5bb68917d0ae3
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Thu, 19 Aug 2021 20:19:12 +0000

assume we do not have a flaky sigpoll

Diffstat:
Mevents.c | 29+----------------------------
Mutil.c | 25+------------------------
2 files changed, 2 insertions(+), 52 deletions(-)

diff --git a/events.c b/events.c @@ -62,14 +62,12 @@ NOTE: #define FASYNC O_ASYNC #endif -#if !defined(FLAKY_SIGPOLL) && !HAVE_STREAMS && !defined(FASYNC) +#if !HAVE_STREAMS && !defined(FASYNC) #if !defined(SIOCSPGRP) || !defined(FIOASYNC) #define FLAKY_SIGPOLL 1 #endif #endif -#ifndef FLAKY_SIGPOLL - #ifndef SIGPOLL #define SIGPOLL SIGIO #endif @@ -98,8 +96,6 @@ NOTE: #endif #endif /* HAVE_STREAMS */ -#endif /* not FLAKY_SIGPOLL */ - #include <poll.h> #include <errno.h> @@ -673,12 +669,7 @@ static short alt_stat; /* 1 = wait for expose, */ * Data for buffered events. */ -#if !FLAKY_SIGPOLL static volatile int event_freq = 70; -#else -#define event_freq 70 -#endif - static void can_exposures(); #if GREY @@ -1743,12 +1734,10 @@ ACTION(Act_minus) static ACTION(Act_quit) { -#if !FLAKY_SIGPOLL if (debug & DBG_EVENT) puts(event_freq < 0 ? "SIGPOLL is working" : "no SIGPOLL signals received"); -#endif xdvi_normal_exit(); } @@ -2863,7 +2852,6 @@ static const signalproc flags_to_sigproc[32] * Signal routines. At the signal level, all we do is set flags. */ -#if !FLAKY_SIGPOLL /* ARGSUSED */ static RETSIGTYPE handle_sigpoll(signo) @@ -2873,7 +2861,6 @@ handle_sigpoll(signo) event_freq = -1; /* forget Plan B */ sig_flags |= SF_POLL; } -#endif /* not FLAKY_SIGPOLL */ /* ARGSUSED */ static RETSIGTYPE @@ -2915,12 +2902,9 @@ handle_sigusr(signo) void enable_intr() { -#ifndef FLAKY_SIGPOLL int sock_fd = ConnectionNumber(DISP); -#endif struct sigaction a; -#ifndef FLAKY_SIGPOLL /* Subprocess handling, e.g., MakeTeXPK, fails on the Alpha without this, because SIGPOLL interrupts the call of system(3), since OSF/1 doesn't retry interrupted wait calls by default. From code by @@ -2932,7 +2916,6 @@ enable_intr() { sigaction(SIGPOLL, &a, NULL); prep_fd(sock_fd, False); -#endif /* not FLAKY_SIGPOLL */ a.sa_handler = handle_sigterm; (void) sigemptyset(&a.sa_mask); @@ -3126,9 +3109,6 @@ clear_io(ip) static void do_sigpoll() { -#if FLAKY_SIGPOLL - sig_flags &= ~SF_POLL; -#else struct xio *ip; sig_flags &= ~SF_POLL; @@ -3169,8 +3149,6 @@ do_sigpoll() if (revents & POLLIN) (ip->read_proc)(); if (revents & POLLOUT) (ip->write_proc)(); } - -#endif /* not FLAKY_SIGPOLL */ } @@ -3375,8 +3353,6 @@ read_events(ret_mask) * drawing on it. */ -#if !FLAKY_SIGPOLL - if (event_freq < 0) { /* if SIGPOLL works */ if (!XtPending()) { @@ -3401,9 +3377,6 @@ read_events(ret_mask) } } else - -#endif /* not FLAKY_SIGPOLL */ - { for (;;) { struct xio *ip; diff --git a/util.c b/util.c @@ -52,33 +52,12 @@ NOTE: # define FASYNC O_ASYNC #endif -#if !defined(FLAKY_SIGPOLL) && !HAVE_STREAMS && !defined(FASYNC) +#if !HAVE_STREAMS && !defined(FASYNC) # if !defined(SIOCSPGRP) || !defined(FIOASYNC) # define FLAKY_SIGPOLL 1 # endif #endif -#if !FLAKY_SIGPOLL && HAVE_STREAMS -# include <stropts.h> - -# ifndef S_RDNORM -# define S_RDNORM S_INPUT -# endif - -# ifndef S_RDBAND -# define S_RDBAND 0 -# endif - -# ifndef S_HANGUP -# define S_HANGUP 0 -# endif - -# ifndef S_WRNORM -# define S_WRNORM S_OUTPUT -# endif - -#endif /* not FLAKY_SIGPOLL && HAVE_STREAMS */ - /* * General utility routines. @@ -827,7 +806,6 @@ prep_fd(int fd, wide_bool noblock) if (noblock) (void) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); -#if !FLAKY_SIGPOLL # if HAVE_STREAMS if (isastream(fd) > 0) { if (ioctl(fd, I_SETSIG, @@ -854,5 +832,4 @@ prep_fd(int fd, wide_bool noblock) perror("xdvi: ioctl FIOASYNC"); # endif } -#endif /* not FLAKY_SIGPOLL */ }