Mailing List Archive

Signal names generation under OS/2
Here is a fatter problem I had under OS/2: Signal name generation was
completely busted.

Two reasons: One row in signal.h looked like

#define SIGTY void

(surrounded by some strange ifdefs). This stopped signal.c from
working. The second problem was that the batch file for signal
generation was named signal.cmd, and it was called during
./signal
If you note that this row appears inside signal.cmd, you note a very
nice recursion ;-).

Solutions: global rename
signal.cmd -> signal_cmd
(signal.sh does not work too :-(), and adding
&& $3 !~ /void/
to the extraction lines. Just in case below is the patch for
Configure:

Best,
Ilya

*** Configure.my Wed Nov 01 22:19:38 1995
--- Configure Thu Nov 02 01:31:28 1995
***************
*** 7860,7869 ****
'') xxxfiles=`./findhdr signal.h` ;;
esac
xxx=`awk '
! $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ {
print substr($2, 4, 20)
}
! $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ {
print substr($3, 4, 20)
}' $xxxfiles`
: Append some common names just in case the awk scan failed.
--- 7860,7869 ----
'') xxxfiles=`./findhdr signal.h` ;;
esac
xxx=`awk '
! $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
print substr($2, 4, 20)
}
! $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
print substr($3, 4, 20)
}' $xxxfiles`
: Append some common names just in case the awk scan failed.
***************
*** 7887,7893 ****
printf "}\n";
}
' >signal.c
! $cat >signal.cmd <<EOS
$startsh
$test -s signal.lst && exit 0
if $cc $ccflags signal.c -o signal $ldflags >/dev/null 2>&1; then
--- 7887,7893 ----
printf "}\n";
}
' >signal.c
! $cat >signal_cmd <<EOS
$startsh
$test -s signal.lst && exit 0
if $cc $ccflags signal.c -o signal $ldflags >/dev/null 2>&1; then
***************
*** 7906,7920 ****
fi
$rm -f signal.c signal signal.o
EOS
! chmod a+x signal.cmd
! $eunicefix signal.cmd

: generate list of signal names
echo " "
case "$sig_name" in
'')
echo "Generating a list of signal names..." >&4
! ./signal.cmd
sig_name=`$awk '{printf "%s ", $1}' signal.lst`
sig_name="ZERO $sig_name"
;;
--- 7906,7920 ----
fi
$rm -f signal.c signal signal.o
EOS
! chmod a+x signal_cmd
! $eunicefix signal_cmd

: generate list of signal names
echo " "
case "$sig_name" in
'')
echo "Generating a list of signal names..." >&4
! ./signal_cmd
sig_name=`$awk '{printf "%s ", $1}' signal.lst`
sig_name="ZERO $sig_name"
;;
***************
*** 7941,7947 ****
case "$sig_num" in
'')
echo "Generating a list of signal numbers..." >&4
! ./signal.cmd
sig_num=`$awk '{printf "%d ", $2}' signal.lst`
sig_num="0 $sig_num"
;;
--- 7941,7947 ----
case "$sig_num" in
'')
echo "Generating a list of signal numbers..." >&4
! ./signal_cmd
sig_num=`$awk '{printf "%d ", $2}' signal.lst`
sig_num="0 $sig_num"
;;
Re: Signal names generation under OS/2 [ In reply to ]
On Thu, 2 Nov 1995, Ilya Zakharevich wrote:

> Here is a fatter problem I had under OS/2: Signal name generation was
> completely busted.
>
> Two reasons: One row in signal.h looked like
>
> #define SIGTY void

Fine.

> ! $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~
/SIGARRAYSIZE/ && $3 !~ /void/ {
^^^
Of course that should be $4 in the second case, but I'll take
care of that, i.e. we're catching
#define SIGTY void
and
# define SIGTY void

Thanks. This will drop in fairly easily into the Signal units,
so I'll take care of it for patch.1o.

Andy Dougherty doughera@lafcol.lafayette.edu