OSDN Git Service

Fix an off-by-one error in the sigset_t function error handling.
authorElliott Hughes <enh@google.com>
Mon, 7 Jan 2013 21:58:49 +0000 (13:58 -0800)
committerElliott Hughes <enh@google.com>
Mon, 7 Jan 2013 21:58:49 +0000 (13:58 -0800)
commitfb5e5cbdd4e1d75594c37ebb544c0f46482a027b
tree310053af341c83e71625b67eb4cba74d6766fe9b
parent26c5b2d460e3b2595eb7f0605edcd02753a13594
Fix an off-by-one error in the sigset_t function error handling.

Spotted while running the tests on MIPS, where sigset_t is
actually large enough. The bits in sigset_t are used such that
signal 1 is represented by bit 0, so the range of signals is
actually [1, 8*sizeof(sigset_t)]; it seems clearer to reword
the code in terms of valid bit offsets [0, 8*sizeof(sigset_t)),
which leads to the usual bounds checking idiom.

Change-Id: Id899c288e15ff71c85dd2fd33c47f8e97aa1956f
libc/include/signal.h
tests/signal_test.cpp