[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r8824 - in /fsf/trunk/libc: ChangeLog test-skeleton.c
- To: commits@xxxxxxxxxx
- Subject: [commits] r8824 - in /fsf/trunk/libc: ChangeLog test-skeleton.c
- From: eglibc@xxxxxxxxxx
- Date: Sat, 15 Aug 2009 07:04:38 -0000
Author: eglibc
Date: Sat Aug 15 00:04:37 2009
New Revision: 8824
Log:
Import glibc-mainline for 2009-08-15
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/test-skeleton.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Aug 15 00:04:37 2009
@@ -1,3 +1,10 @@
+2009-08-14 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * test-skeleton.c (signal_handler): Renamed from timeout_handler.
+ Also handle SIGINT. In that case only do the cleanup and then
+ re-raise the signal.
+ (main): Install handler for SIGINT.
+
2009-08-10 SUGIOKA Toshinobu <sugioka@xxxxxxxxxxxx>
* stdlib/longlong.h [__sh__] (udiv_qrnnd, sub_ddmmss): Add "t" to
Modified: fsf/trunk/libc/test-skeleton.c
==============================================================================
--- fsf/trunk/libc/test-skeleton.c (original)
+++ fsf/trunk/libc/test-skeleton.c Sat Aug 15 00:04:37 2009
@@ -1,5 +1,5 @@
/* Skeleton for test programs.
- Copyright (C) 1998,2000-2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998,2000-2004, 2005, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -132,7 +132,7 @@
/* Timeout handler. We kill the child and exit with an error. */
static void
__attribute__ ((noreturn))
-timeout_handler (int sig __attribute__ ((unused)))
+signal_handler (int sig __attribute__ ((unused)))
{
int killed;
int status;
@@ -166,6 +166,12 @@
#ifdef CLEANUP_HANDLER
CLEANUP_HANDLER;
#endif
+
+ if (sig == SIGINT)
+ {
+ signal (sig, SIG_DFL);
+ raise (sig);
+ }
/* If we expected this signal: good! */
#ifdef EXPECTED_SIGNAL
@@ -325,8 +331,11 @@
/* Default timeout is two seconds. */
# define TIMEOUT 2
#endif
- signal (SIGALRM, timeout_handler);
+ signal (SIGALRM, signal_handler);
alarm (TIMEOUT * timeoutfactor);
+
+ /* Make sure we clean up if the wrapper gets interrupted. */
+ signal (SIGINT, signal_handler);
/* Wait for the regular termination. */
termpid = TEMP_FAILURE_RETRY (waitpid (pid, &status, 0));