diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-09-15 04:25:03 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-09-15 04:25:03 +0000 |
commit | 608c5afdcc09b5082e58d4f2e11683ebe26cdf1b (patch) | |
tree | 5e1a3a64b93b721f24d28d02863d18677ff3bf91 | |
parent | 7ae4abe9af5d7c76c7ab01a72aebe307a06120e1 (diff) | |
download | glibc-608c5afdcc09b5082e58d4f2e11683ebe26cdf1b.tar glibc-608c5afdcc09b5082e58d4f2e11683ebe26cdf1b.tar.gz glibc-608c5afdcc09b5082e58d4f2e11683ebe26cdf1b.tar.bz2 glibc-608c5afdcc09b5082e58d4f2e11683ebe26cdf1b.zip |
Update.
* test-skeleton.c (main): Provide more information in case waitpid
fails.
-rw-r--r-- | .cvsignore | 2 | ||||
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | test-skeleton.c | 14 |
3 files changed, 15 insertions, 4 deletions
diff --git a/.cvsignore b/.cvsignore index e9b99fe5fb..e801b5a8e8 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,5 +1,5 @@ *.d *.o *.so *.po *.go *.bo stamp.* *.stamp *.ustamp *.udeps -*.gz *.Z *.tar *.tgz +*.gz *.Z *.tar *.tgz *.bz2 =* TODO AUTHORS copyr-* copying.* glibc-* @@ -1,5 +1,8 @@ 2002-09-14 Ulrich Drepper <drepper@redhat.com> + * test-skeleton.c (main): Provide more information in case waitpid + fails. + * include/unistd.h: Declare __exit_thread. * sysdeps/generic/libc-start.c: Remove dummy_addr. Wrap call to main in setjmp if HAVE_CANCELBUF is defined. diff --git a/test-skeleton.c b/test-skeleton.c index 47b0143d7f..e36eee7eb4 100644 --- a/test-skeleton.c +++ b/test-skeleton.c @@ -50,7 +50,7 @@ static struct option options[] = }; /* PID of the test itself. */ -static int pid; +static pid_t pid; /* Directory to place temporary files in. */ static const char *test_dir; @@ -157,6 +157,7 @@ main (int argc, char *argv[]) int direct = 0; /* Directly call the test function? */ int status; int opt; + pid_t termpid; #ifdef STDOUT_UNBUFFERED setbuf (stdout, NULL); @@ -250,9 +251,16 @@ main (int argc, char *argv[]) signal (SIGALRM, timeout_handler); /* Wait for the regular termination. */ - if (waitpid (pid, &status, 0) != pid) + termpid = waitpid (pid, &status, 0); + if (termpid == -1) { - perror ("Oops, wrong test program terminated"); + printf ("Waiting for test program failed: %m\n"); + exit (1); + } + if (termpid != pid) + { + printf ("Oops, wrong test program terminated: expected %ld, got %ld\n", + (long int) pid, (long int) termpid); exit (1); } |