Module Name: othersrc Committed By: lukem Date: Mon Feb 1 09:52:19 UTC 2016
Modified Files: othersrc/usr.bin/tnftp/libedit: sig.c Log Message: sig.c: reduce differences to upstream libedit Reduces differences to upstream libedit: - Use "config.h" again. - Use sigaction() et al instead of xsignal_restart() from progressbar.c. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 othersrc/usr.bin/tnftp/libedit/sig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: othersrc/usr.bin/tnftp/libedit/sig.c diff -u othersrc/usr.bin/tnftp/libedit/sig.c:1.7 othersrc/usr.bin/tnftp/libedit/sig.c:1.8 --- othersrc/usr.bin/tnftp/libedit/sig.c:1.7 Sun Jan 31 08:43:50 2016 +++ othersrc/usr.bin/tnftp/libedit/sig.c Mon Feb 1 09:52:19 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: sig.c,v 1.7 2016/01/31 08:43:50 lukem Exp $ */ +/* $NetBSD: sig.c,v 1.8 2016/02/01 09:52:19 lukem Exp $ */ /* from NetBSD: sig.c,v 1.17 2011/07/28 20:50:55 christos Exp */ /*- @@ -33,11 +33,9 @@ * SUCH DAMAGE. */ -#include "tnftp.h" -#include "sys.h" - -#if 0 #include "config.h" + +#if 0 /* tnftp */ #if !defined(lint) && !defined(SCCSID) #if 0 static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93"; @@ -45,7 +43,7 @@ static char sccsid[] = "@(#)sig.c 8.1 (B __RCSID(" NetBSD: sig.c,v 1.17 2011/07/28 20:50:55 christos Exp "); #endif #endif /* not lint && not SCCSID */ -#endif +#endif /* tnftp */ /* * sig.c: Signal handling stuff. @@ -53,9 +51,10 @@ __RCSID(" NetBSD: sig.c,v 1.17 2011/07/2 * and pass the ball to our caller. */ #include "el.h" -#include <stdlib.h> -#include "src/progressbar.h" /* for xsignal_restart() */ +#if 0 /* tnftp */ +#include <stdlib.h> +#endif /* tnftp */ private EditLine *sel = NULL; @@ -106,14 +105,10 @@ sig_handler(int signo) if (signo == sighdl[i]) break; -#if 1 - (void) xsignal_restart(signo, sel->el_signal[i], 1); -#else (void) sigaction(signo, &sel->el_signal->sig_action[i], NULL); sel->el_signal->sig_action[i].sa_handler = SIG_ERR; sel->el_signal->sig_action[i].sa_flags = 0; sigemptyset(&sel->el_signal->sig_action[i].sa_mask); -#endif (void) sigprocmask(SIG_SETMASK, &oset, NULL); (void) kill(0, signo); } @@ -181,14 +176,9 @@ sig_set(EditLine *el) for (i = 0; sighdl[i] != -1; i++) { /* This could happen if we get interrupted */ -#if 1 - if ((s = xsignal_restart(sighdl[i], sig_handler, 1)) != sig_handler) - el->el_signal[i] = s; -#else if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) el->el_signal->sig_action[i] = osa; -#endif } sel = el; (void) sigprocmask(SIG_SETMASK, &oset, NULL); @@ -207,14 +197,9 @@ sig_clr(EditLine *el) (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) -#if 1 - if (el->el_signal[i] != SIG_ERR) - (void) xsignal_restart(sighdl[i], el->el_signal[i], 1); -#else if (el->el_signal->sig_action[i].sa_handler != SIG_ERR) (void)sigaction(sighdl[i], &el->el_signal->sig_action[i], NULL); -#endif sel = NULL; /* we are going to die if the handler is * called */