ed/signal.patch

66 lines
1.3 KiB
Diff

--- configure.in
+++ configure.in
@@ -11,11 +11,11 @@
AC_C_CONST
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h memory.h string.h unistd.h locale.h)
-AC_CHECK_FUNCS(setbuffer sigsetjmp sigaction strerror)
+AC_CHECK_FUNCS(setbuffer siglongjmp sigaction strerror)
AC_FUNC_VPRINTF
AC_FUNC_ALLOCA
if test "$ALLOCA" = alloca.o; then
- AC_SUBST(LIBOBJS)LIBOBJS="$LIBOBJS xmalloc.o error.o"
+ AC_LIBOBJ(xmalloc) AC_LIBOBJ(error)
fi
AC_OUTPUT(Makefile)
--- main.c
+++ main.c
@@ -68,7 +68,7 @@
#include "getopt.h"
-#ifdef HAVE_SIGSETJMP
+#ifdef HAVE_SIGLONGJMP
sigjmp_buf env;
#else
jmp_buf env;
@@ -219,7 +219,7 @@
reliable_signal (SIGHUP, signal_hup);
reliable_signal (SIGQUIT, SIG_IGN);
reliable_signal (SIGINT, signal_int);
-#ifdef HAVE_SIGSETJMP
+#ifdef HAVE_SIGLONGJMP
if (status = sigsetjmp (env, 1))
#else
if (status = setjmp (env))
--- signal.c
+++ signal.c
@@ -39,7 +39,7 @@
void (*hndlr) ();
{
#ifndef HAVE_SIGACTION
- signal (sno, hndlr);
+ return signal (sno, hndlr);
#else
struct sigaction sa, osa;
@@ -76,7 +76,7 @@
}
-#ifdef HAVE_SIGSETJMP
+#ifdef HAVE_SIGLONGJMP
extern sigjmp_buf env;
#else
extern jmp_buf env;
@@ -116,7 +116,7 @@
if (!sigactive)
quit (1);
sigflags &= ~(1 << (signo - 1));
-#ifdef HAVE_SIGSETJMP
+#ifdef HAVE_SIGLONGJMP
siglongjmp (env, -1);
#else
longjmp (env, -1);