sigprocmask-tests: skip test if pid is unexpectedly large
authorEric Blake <eblake@redhat.com>
Mon, 31 Dec 2012 23:51:29 +0000 (16:51 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 31 Dec 2012 23:59:00 +0000 (16:59 -0700)
commite62439a54a711bbaeee685fc058ebc876cc7650e
treeba1bbbad512c4488a73fb9bf0c3c0867eb121726
parentd4d4aa2ee0869eebacf0322d35dcd12b576eeef3
sigprocmask-tests: skip test if pid is unexpectedly large

At least mingw64 has 8-byte pid_t but only 4-byte long.  Silent
truncation to int in printing a pid value with %d risks killing the
wrong process.  But rather than try to futz with determining
the maximum pid_t, it is simpler to just cap things by realizing
that this test is already skipped on mingw64, so adding a sanity
check bounds comparison (and hard-coding the result rather than
dragging in headers for INT_MAX) is just as effective at avoiding
theoretical problems with no real loss in test coverage.

* tests/test-sigprocmask.c (main): Add range check.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
tests/test-sigprocmask.c