Home | History | Annotate | Download | only in sh

Lines Matching defs:trap

1 /*	$NetBSD: trap.c,v 1.31 2005/01/11 19:38:57 christos Exp $	*/
38 static char sccsid[] = "@(#)trap.c 8.5 (Berkeley) 6/5/95";
40 __RCSID("$NetBSD: trap.c,v 1.31 2005/01/11 19:38:57 christos Exp $");
59 #include "trap.h"
76 char *trap[NSIG+1]; /* trap handler commands */
128 * The trap builtin.
140 if (trap[signo] != NULL) {
141 out1fmt("trap -- ");
142 print_quoted(trap[signo]);
178 error("%s: bad trap", *ap);
184 if (trap[signo])
185 ckfree(trap[signo]);
187 trap[signo] = action;
210 for (tp = trap ; tp <= &trap[NSIG] ; tp++) {
211 if (*tp && **tp) { /* trap not NULL or SIG_IGN */
217 if (tp != &trap[0])
218 setsignal(tp - trap, vforked);
239 if ((t = trap[signo]) == NULL)
345 INCLUDE "trap.h"
368 if (signo == SIGINT && trap[SIGINT] == NULL) {
379 * Called to execute a trap. Perhaps we should avoid entering new trap
380 * handlers while we are executing a trap handler.
398 evalstring(trap[i], 0);
445 if ((p = trap[0]) != NULL && *p != '\0') {
446 trap[0] = NULL;