gdb/
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / foll-fork.c
index 841258f147ca5c4665b5877cdb6030d9540b5e0e..b7e69abfb1254c28cc037cc17b6b2a76fcbee884 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <unistd.h>
+#include <stdlib.h>
 
 #ifdef PROTOTYPES
 void callee (int i)
@@ -21,14 +22,18 @@ main ()
   int  v = 5;
 
   pid = fork ();
-  if (pid == 0)
+  if (pid == 0) /* set breakpoint here */
     {
       v++;
       /* printf ("I'm the child!\n"); */
+      callee (getpid ());
     }
   else
     {
       v--;
       /* printf ("I'm the proud parent of child #%d!\n", pid); */
+      callee (getpid ());
     }
+
+  exit (0); /* at exit */
 }
This page took 0.023668 seconds and 4 git commands to generate.