Mercurial > gnulib
diff tests/test-passfd.c @ 17356:639f60219717
tests: make it easier to bypass alarm time in debugger
While auditing alarm usage, I noticed that test-regex had a nice
idiom that made it easier to disable an alarm under glibc. Use
it elsewhere, so future copy-and-paste will preserve the idiom.
* tests/test-file-has-acl.c (main): Allow gdb to override alarm.
* tests/test-memmem.c (main): Likewise.
* tests/test-passfd.c (main): Likewise.
* tests/test-ptsname.c (main): Likewise.
* tests/test-ptsname_r.c (main): Likewise.
* tests/test-strcasestr.c (main): Likewise.
* tests/test-strstr.c (main): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Mon, 11 Mar 2013 15:40:32 -0600 |
parents | e542fd46ad6f |
children | c67bafa8ca26 |
line wrap: on
line diff
--- a/tests/test-passfd.c Mon Mar 11 14:51:33 2013 -0600 +++ b/tests/test-passfd.c Mon Mar 11 15:40:32 2013 -0600 @@ -45,8 +45,9 @@ # if HAVE_DECL_ALARM /* Avoid hanging on failure. */ + int alarm_value = 5; signal (SIGALRM, SIG_DFL); - alarm (5); + alarm (alarm_value); # endif fdnull = open ("/dev/null", O_RDWR);