From 4d0b77d39867ab5058e6f108bac9238fbca01672 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sat, 9 Jan 2021 13:18:00 +0000 Subject: [PATCH] Revert "Fix SIGALRM core dump (Solaris patch 230-18229654)" This reverts commit 13e7b262. It caused the regression test for the 'alarm' builtin, introduced in 18b3f4aa, to hang on FreeBSD. --- src/cmd/ksh93/bltins/alarm.c | 2 +- src/cmd/ksh93/sh/xec.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/cmd/ksh93/bltins/alarm.c b/src/cmd/ksh93/bltins/alarm.c index 6f0833698..5d152cc16 100644 --- a/src/cmd/ksh93/bltins/alarm.c +++ b/src/cmd/ksh93/bltins/alarm.c @@ -134,7 +134,7 @@ static void trap_timeout(void* handle) tp->timeout = 0; tp->flags |= L_FLAG; tp->sh->sigflag[SIGALRM] |= SH_SIGALRM; - if(sh_isstate(SH_TTYWAIT) && !tp->sh->bltinfun) + if(sh_isstate(SH_TTYWAIT)) sh_timetraps(tp->sh); } diff --git a/src/cmd/ksh93/sh/xec.c b/src/cmd/ksh93/sh/xec.c index 85844f5be..f34fb5e1b 100644 --- a/src/cmd/ksh93/sh/xec.c +++ b/src/cmd/ksh93/sh/xec.c @@ -2643,11 +2643,6 @@ int sh_exec(register const Shnode_t *t, int flags) break; } } - if(shp->trapnote&SH_SIGALRM) - { - shp->trapnote &= ~SH_SIGALRM; - sh_timetraps(shp); - } if(shp->trapnote || (shp->exitval && sh_isstate(SH_ERREXIT)) && t && echeck) sh_chktrap(shp);