some spacing; move array into function

This commit is contained in:
tg 2005-05-23 12:06:39 +00:00
parent f158d4d0df
commit 13afe3c10c
2 changed files with 12 additions and 14 deletions

View File

@ -1,11 +1,11 @@
#!/bin/sh
# $MirOS: src/bin/mksh/gensigs.sh,v 1.1 2005/05/23 12:01:09 tg Exp $
# $MirOS: src/bin/mksh/gensigs.sh,v 1.2 2005/05/23 12:06:39 tg Exp $
echo '#include <signal.h>' | $CC -E -dD -D_ANSI_SOURCE - \
| grep '[ ]SIG[A-Z0-9]*[ ]' \
| sed 's/^\(.*[ ]SIG\)\([A-Z0-9]*\)\([ ].*\)$/\2/' \
| while read name; do
( echo '#include <signal.h>'; echo "__mksh_test: SIG$name" ) \
| $CC -E - | fgrep __mksh_test: \
| sed 's/^__mksh_test: \([0-9]*\).*$/ { \1, "'$name'" },/'
| $CC -E - | fgrep __mksh_test: | sed \
's/^__mksh_test: \([0-9]*\).*$/ { \1, "'$name'" },/'
done | fgrep -v '{ ,' >signames.inc

View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/histrap.c,v 1.2 2005/05/23 12:01:09 tg Exp $ */
/** $MirOS: src/bin/mksh/histrap.c,v 1.3 2005/05/23 12:06:39 tg Exp $ */
/* $OpenBSD: history.c,v 1.30 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: trap.c,v 1.22 2005/03/30 17:16:37 deraadt Exp $ */
@ -8,7 +8,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.2 2005/05/23 12:01:09 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.3 2005/05/23 12:06:39 tg Exp $");
static int histfd;
static int hsize;
@ -968,19 +968,17 @@ sprinkle(int fd)
}
#ifdef NEED_MKSH_SIGNAME
struct _mksh_sigpair {
int nr;
const char *name;
} mksh_sigpair[] = {
#include "signames.inc"
{ 0, NULL }
};
static const char * const
mksh_signame(int s)
{
int i = 0;
static const struct _mksh_sigpair {
int nr;
const char *name;
} const mksh_sigpair[] = {
#include "signames.inc"
{ 0, NULL }
};
while (mksh_sigpair[i].name != NULL) {
if (mksh_sigpair[i].nr == s)