about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-01-19 15:41:14 +0000
committerUlrich Drepper <drepper@redhat.com>1999-01-19 15:41:14 +0000
commitd48f4d530eb492bd008318facff31bb725b066f5 (patch)
treea2e67e8d15d722537f88330b923c47c15cc7393e
parentd53afacb5553ca5c62a11c8185391afe0e745d9a (diff)
downloadglibc-d48f4d530eb492bd008318facff31bb725b066f5.tar.gz
glibc-d48f4d530eb492bd008318facff31bb725b066f5.tar.xz
glibc-d48f4d530eb492bd008318facff31bb725b066f5.zip
Update.
	* posix/test-vfork.c (main): Improve test to check for correct
	exit code.
-rw-r--r--ChangeLog3
-rw-r--r--posix/test-vfork.c11
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 79a9ff5762..7c7190166d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-01-19  Ulrich Drepper  <drepper@cygnus.com>
 
+	* posix/test-vfork.c (main): Improve test to check for correct
+	exit code.
+
 	* sysdeps/unix/sysv/linux/i386/vfork.S: Rewrite to use clone.
 
 	* sysdeps/unix/sysv/linux/bits/sched.h: Define CLONE_VFORK.
diff --git a/posix/test-vfork.c b/posix/test-vfork.c
index 9c352897ed..959dcb3b01 100644
--- a/posix/test-vfork.c
+++ b/posix/test-vfork.c
@@ -6,10 +6,13 @@
 
 void noop (void);
 
+#define NR	2	/* Exit code of the child.  */
+
 int
 main (void)
 {
-  int pid;
+  pid_t pid;
+  int status;
 
   printf ("Before vfork\n");
   fflush (stdout);
@@ -20,12 +23,14 @@ main (void)
 	 machines where it is stored on the stack, if vfork wasn't
 	 implemented correctly, */
       noop ();
-      _exit (2);
+      _exit (NR);
     }
   else if (pid < 0)
     error (1, errno, "vfork");
   printf ("After vfork (parent)\n");
-  wait (0);
+  if (waitpid (0, &status, 0) != pid
+      || !WIFEXITED (status) || WEXITSTATUS (NR))
+    exit (1);
   exit (0);
 }