Mercurial > hg > octave-lojdl > gnulib-hg
comparison tests/test-passfd.c @ 17367: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 |
comparison
equal
deleted
inserted
replaced
17366:9855b352e525 | 17367:639f60219717 |
---|---|
43 int fd; | 43 int fd; |
44 struct stat st; | 44 struct stat st; |
45 | 45 |
46 # if HAVE_DECL_ALARM | 46 # if HAVE_DECL_ALARM |
47 /* Avoid hanging on failure. */ | 47 /* Avoid hanging on failure. */ |
48 int alarm_value = 5; | |
48 signal (SIGALRM, SIG_DFL); | 49 signal (SIGALRM, SIG_DFL); |
49 alarm (5); | 50 alarm (alarm_value); |
50 # endif | 51 # endif |
51 | 52 |
52 fdnull = open ("/dev/null", O_RDWR); | 53 fdnull = open ("/dev/null", O_RDWR); |
53 if (fdnull < 0) | 54 if (fdnull < 0) |
54 { | 55 { |