diff tests/test-ptsname_r.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
line wrap: on
line diff
--- a/tests/test-ptsname_r.c
+++ b/tests/test-ptsname_r.c
@@ -104,8 +104,9 @@
 #if HAVE_DECL_ALARM
   /* Declare failure if test takes too long, by using default abort
      caused by SIGALRM.  */
+  int alarm_value = 5;
   signal (SIGALRM, SIG_DFL);
-  alarm (5);
+  alarm (alarm_value);
 #endif
 
   {