[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Signal handling broken
From: |
Claudio Fontana |
Subject: |
Re: Signal handling broken |
Date: |
Mon, 9 Oct 2006 11:17:53 -0700 (PDT) |
--- Andreas Schwab <address@hidden> wrote:
> The signal handling in ed 0.3-pre2 is broken. After
> interrupting it the
> first time it cannot be interrupted any more. The
> reason is quite
> obvious: it no longer uses sigsetjmp/siglongjmp.
>
> Andreas.
I noticed that too. In truth, it did not work with 0.2
either under GNU/Linux.
That's because a configuration check is made for
sigsetjmp, and under GNU/Linux it is implemented as a
macro, as the standard warns about.
A fix (for 0.2) is to replace the check with a check
for siglongjmp, and use the corresponding #ifdef.
Then of course autoconf should be re-run.
I attach a patch (for 0.2 only).
Claudio
__________________________________________________
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto
spazio gratuito per i tuoi file e i messaggi
http://mail.yahoo.it
--- ed-0.2/configure.in 1994-11-19 13:38:00.000000000 +0100
+++ ed-0.2-signals-working/configure.in 2006-10-09 20:01:38.000000000 +0200
@@ -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 sigaction strerror siglongjmp)
AC_FUNC_VPRINTF
AC_FUNC_ALLOCA
if test "$ALLOCA" = alloca.o; then
- AC_SUBST(LIBOBJS)LIBOBJS="$LIBOBJS xmalloc.o error.o"
+AC_LIBOBJ(xmalloc error)
fi
AC_OUTPUT(Makefile)
--- ed-0.2/main.c 1994-11-19 13:38:02.000000000 +0100
+++ ed-0.2-signals-working/main.c 2006-10-09 20:02:18.000000000 +0200
@@ -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))
--- ed-0.2/signal.c 1994-11-19 13:38:04.000000000 +0100
+++ ed-0.2-signals-working/signal.c 2006-10-09 20:11:03.000000000 +0200
@@ -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);