mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 06:50:12 +00:00
tests: fix signo to signame lookup in opr/softsig tests
Fix the loop condition when scanning the signal number to name table to convert a signal number to a name. Instead of looping sizeof(size_t) times, loop for the number of elements in the table. This bug was masked on 64 bit-platforms, since the signal number to name table table currently has 8 elements, which is coincidently the same as sizeof(size_t) on 64-bit platforms. The bug becomes apparent on 32-bit systems; only the first 4 elements of the table are checked. Example error output before this fix: $ cd tests $ ./libwrap ../lib ./runtests -o opr/softsig 1..11 ok 1 ok 2 ok 3 ok 4 ok 5 not ok 6 # Failed test in ./opr/softsig-t at line 57. # got: 'Received UNK # ' # expected: 'Received TERM # ' not ok 7 # Failed test in ./opr/softsig-t at line 60. # got: 'Received UNK # ' # expected: 'Received USR1 # ' not ok 8 # Failed test in ./opr/softsig-t at line 63. # got: 'Received UNK # ' # expected: 'Received USR2 # ' ok 9 - Helper exited on KILL signal. ok 10 - Helper exited on SEGV signal. ok 11 # skip Skipping buserror test; SIGBUS constant is not defined. # Looks like you failed 3 tests of 11. Change-Id: I863cc9f3650c4a5e9ac9159d90e063b986a8460a Reviewed-on: https://gerrit.openafs.org/12367 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
parent
1d8cb56999
commit
8b2c4665aa
@ -55,7 +55,7 @@ static struct sigtable {
|
||||
static char *signame(int signo) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(sizeof(sigtable) / sizeof(sigtable[0])); ++i) {
|
||||
for (i = 0; i < sizeof(sigtable) / sizeof(sigtable[0]); ++i) {
|
||||
if (sigtable[i].signo == signo) {
|
||||
return sigtable[i].name;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user