mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 15:25:01 +00:00
No more signal trapping.
This commit is contained in:
@@ -152,10 +152,6 @@ MH_SHARED_LIBRARY(XCurses)
|
||||
AC_CONFIG_FILES([Makefile xcurses-config])
|
||||
AC_OUTPUT
|
||||
|
||||
AC_DEFINE([PDC_MAX_SIGNALS], [],
|
||||
[Define as the system defined limit for number of signals]
|
||||
)
|
||||
|
||||
AC_DEFINE([HAVE_DECKEYSYM_H], [],
|
||||
[Define if you have the <DECkeySym.h> header file]
|
||||
)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <signal.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
73
x11/x11.c
73
x11/x11.c
@@ -399,35 +399,6 @@ static Atom XA_UTF8_STRING(Display *dpy)
|
||||
}
|
||||
#endif
|
||||
|
||||
signal_handler XCursesSetSignal(int signo, signal_handler action)
|
||||
{
|
||||
#if defined(SA_INTERRUPT) || defined(SA_RESTART)
|
||||
struct sigaction sigact, osigact;
|
||||
|
||||
sigact.sa_handler = action;
|
||||
|
||||
sigact.sa_flags =
|
||||
# ifdef SA_INTERRUPT
|
||||
# ifdef SA_RESTART
|
||||
SA_INTERRUPT | SA_RESTART;
|
||||
# else
|
||||
SA_INTERRUPT;
|
||||
# endif
|
||||
# else /* must be SA_RESTART */
|
||||
SA_RESTART;
|
||||
# endif
|
||||
sigemptyset(&sigact.sa_mask);
|
||||
|
||||
if (sigaction(signo, &sigact, &osigact))
|
||||
return SIG_ERR;
|
||||
|
||||
return osigact.sa_handler;
|
||||
|
||||
#else /* not SA_INTERRUPT or SA_RESTART, use plain signal */
|
||||
return signal(signo, action);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Convert character positions x and y to pixel positions, stored in
|
||||
xpos and ypos */
|
||||
|
||||
@@ -1732,43 +1703,6 @@ static void _handle_structure_notify(Widget w, XtPointer client_data,
|
||||
}
|
||||
}
|
||||
|
||||
static void _handle_signals(int signo)
|
||||
{
|
||||
PDC_LOG(("%s:_handle_signals() - called: %d\n", XCLOGMSG, signo));
|
||||
|
||||
/* Patch by: Georg Fuchs */
|
||||
|
||||
XCursesSetSignal(signo, _handle_signals);
|
||||
|
||||
#ifdef SIGTSTP
|
||||
if (signo == SIGTSTP)
|
||||
{
|
||||
pause();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef SIGCONT
|
||||
if (signo == SIGCONT)
|
||||
return;
|
||||
#endif
|
||||
#ifdef SIGCLD
|
||||
if (signo == SIGCLD)
|
||||
return;
|
||||
#endif
|
||||
#ifdef SIGTTIN
|
||||
if (signo == SIGTTIN)
|
||||
return;
|
||||
#endif
|
||||
#ifdef SIGWINCH
|
||||
if (signo == SIGWINCH)
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* End of patch by: Georg Fuchs */
|
||||
|
||||
XCursesSetSignal(signo, SIG_IGN);
|
||||
}
|
||||
|
||||
static void _dummy_handler(Widget w, XtPointer client_data,
|
||||
XEvent *event, Boolean *unused)
|
||||
{
|
||||
@@ -1795,13 +1729,6 @@ int XCursesSetupX(int argc, char *argv[])
|
||||
|
||||
program_name = argv[0];
|
||||
|
||||
/* Trap all signals, but only if they haven't already been ignored
|
||||
by the application. */
|
||||
|
||||
for (i = 0; i < PDC_MAX_SIGNALS; i++)
|
||||
if (XCursesSetSignal(i, _handle_signals) == SIG_IGN)
|
||||
XCursesSetSignal(i, SIG_IGN);
|
||||
|
||||
/* Start defining X Toolkit things */
|
||||
|
||||
#if XtSpecificationRelease > 4
|
||||
|
||||
Reference in New Issue
Block a user