diff options
Diffstat (limited to 'shells/pdksh/files/siglist.sh')
-rwxr-xr-x | shells/pdksh/files/siglist.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/shells/pdksh/files/siglist.sh b/shells/pdksh/files/siglist.sh index 952edc40be8..e863a8a497d 100755 --- a/shells/pdksh/files/siglist.sh +++ b/shells/pdksh/files/siglist.sh @@ -1,5 +1,5 @@ #!/bin/sh - +# $NetBSD: siglist.sh,v 1.2 2008/05/31 16:47:37 tnn Exp $ # # Script to generate a sorted, complete list of signals, suitable # for inclusion in trap.c as array initializer. @@ -20,18 +20,18 @@ CPP="${1-cc -E}" echo '#include "sh.h"'; echo ' { QwErTy SIGNALS , "DUMMY" , "hook for number of signals" },'; sed -e '/^[ ]*#/d' -e 's/^[ ]*\([^ ][^ ]*\)[ ][ ]*\(.*[^ ]\)[ ]*$/#ifdef SIG\1\ - { QwErTy SIG\1 , "\1", "\2" },\ + { QwErTy .signal = SIG\1 , .name = "\1", .mess = "\2" },\ #endif/') > $in $CPP $in > $out -sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort +2n +0n | +sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort -k5n -k1n | sed 's/^[0-9]* //' | awk 'BEGIN { last=0; nsigs=0; } { - if ($2 ~ /^[0-9][0-9]*$/ && $3 == ",") { - n = $2; + if ($4 ~ /^[0-9][0-9]*$/ && $5 == ",") { + n = $4; if (n > 0 && n != last) { while (++last < n) { - printf "\t{ %d , (char *) 0, `Signal %d` } ,\n", last, last; + printf "\t{ .signal = %d , .name = NULL, .mess = `Signal %d` } ,\n", last, last; } print; } |