summaryrefslogtreecommitdiff
path: root/test/test-skeleton.c
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2009-11-22 11:46:31 -0800
committerAustin Foxley <austinf@cetoncorp.com>2009-11-22 11:51:37 -0800
commitf757db2d319ccc5f7034165046fb2bb58901afb1 (patch)
tree7dc465febb3a802d3f0e8856fcda856b13b04c0a /test/test-skeleton.c
parent76c0c0ed99f74b8a5965be6e1c6a0c0e7a72513c (diff)
parentb71274eebd68b7c68ab95c856f8075bdf4524cd7 (diff)
Merge remote branch 'origin/master' into nptl_merge
Conflicts: Rules.mak libc/misc/sysvipc/msgq.c test/Rules.mak Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'test/test-skeleton.c')
-rw-r--r--test/test-skeleton.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/test-skeleton.c b/test/test-skeleton.c
index c61d09e82..752158405 100644
--- a/test/test-skeleton.c
+++ b/test/test-skeleton.c
@@ -137,14 +137,15 @@ timeout_handler (int sig __attribute__ ((unused)))
{
int killed = 0;
int status;
+ int i;
/* Send signal. */
kill (pid, SIGKILL);
/* Wait for it to terminate. */
- int i;
for (i = 0; i < 5; ++i)
{
+ struct timespec ts;
killed = waitpid (pid, &status, WNOHANG|WUNTRACED);
if (killed != 0)
break;
@@ -153,7 +154,6 @@ timeout_handler (int sig __attribute__ ((unused)))
nanosleep() call return prematurely, all the better. We
won't restart it since this probably means the child process
finally died. */
- struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 100000000;
nanosleep (&ts, NULL);
@@ -213,6 +213,7 @@ main (int argc, char *argv[])
int opt;
unsigned int timeoutfactor = 1;
pid_t termpid;
+ char *envstr_timeoutfactor;
/* Make uses of freed and uninitialized memory known. */
#ifdef __MALLOC_STANDARD__
@@ -244,7 +245,7 @@ main (int argc, char *argv[])
/* If set, read the test TIMEOUTFACTOR value from the environment.
This value is used to scale the default test timeout values. */
- char *envstr_timeoutfactor = getenv ("TIMEOUTFACTOR");
+ envstr_timeoutfactor = getenv ("TIMEOUTFACTOR");
if (envstr_timeoutfactor != NULL)
{
char *envstr_conv = envstr_timeoutfactor;
@@ -303,6 +304,9 @@ main (int argc, char *argv[])
if (pid == 0)
{
/* This is the child. */
+#ifdef RLIMIT_DATA
+ struct rlimit data_limit;
+#endif
#ifdef RLIMIT_CORE
/* Try to avoid dumping core. */
struct rlimit core_limit;
@@ -313,7 +317,6 @@ main (int argc, char *argv[])
#ifdef RLIMIT_DATA
/* Try to avoid eating all memory if a test leaks. */
- struct rlimit data_limit;
if (getrlimit (RLIMIT_DATA, &data_limit) == 0)
{
if (TEST_DATA_LIMIT == RLIM_INFINITY)