From: Antoine Leca Date: Tue, 26 Jul 2011 11:49:20 +0000 (+0200) Subject: ash: don't rely on libc signal names X-Git-Tag: v3.2.0~406 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/verify-sign/verify.pl?a=commitdiff_plain;h=b67a7fca8c3bdabc2fc28220b2f7e8c5212d4a43;p=minix.git ash: don't rely on libc signal names The bsd signal names are out-of-order compared to the minix ones. I found out (the hard way) that the (MINIX-descending) ordered list of signals in does not match the (BSD-descending) ordered list of signals in usr/src/lib/libc/nbsd_libc/gen/sig{name,list}.c Beyond being unfortunate, it prevents the trap command of ash to handle correctly a named signal; a funny test case is #!/bin/sh trap 'echo trapping signal BUS' BUS trap 'echo trapping signal 10 (USR1)' 10 trap # show me what is currently trapped As a quick workaround, I disabled the use of the libc-provided sys_sig{name,list} arrays for ash, and reverted to the hand-made array which is used by the less capable MINIX libc. It allowed me to use pkgsrc. --- diff --git a/commands/ash/trap.c b/commands/ash/trap.c index 204097351..a1daa08eb 100644 --- a/commands/ash/trap.c +++ b/commands/ash/trap.c @@ -62,8 +62,10 @@ __FBSDID("$FreeBSD: src/bin/sh/trap.c,v 1.29 2004/04/06 20:06:51 markm Exp $"); #endif #include "builtins.h" -#if defined(__minix) && !defined(__NBSD_LIBC) +#if defined(__minix) +#if !defined(__NBSD_LIBC) #define NO_SIGINTERRUPT +#endif #define NO_SYS_SIGNAME #define NO_SYS_SIGLIST #endif