clone: wait until child completes

If parent doesn't wait for child to finish,
ltp-pan detects these as 'orpahns' and will try
to kill them, which can result in TBROK messages:
http://article.gmane.org/gmane.linux.ltp/16993

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
diff --git a/testcases/kernel/syscalls/clone/clone07.c b/testcases/kernel/syscalls/clone/clone07.c
index 3ad7fe7..c4df76d 100644
--- a/testcases/kernel/syscalls/clone/clone07.c
+++ b/testcases/kernel/syscalls/clone/clone07.c
@@ -98,7 +98,7 @@
 int main(int ac, char **av)
 {
 
-	int lc;
+	int lc, status;
 	char *msg;
 	void *child_stack;	/* stack for child */
 
@@ -120,7 +120,9 @@
 		 */
 		child_pid = ltp_clone(SIGCHLD, do_child, NULL,
 				CHILD_STACK_SIZE, child_stack);
-		wait(NULL);
+		if ((wait(&status)) == -1)
+			tst_brkm(TBROK|TERRNO, cleanup,
+				"wait failed, status: %d", status);
 		free(child_stack);
 	}