Skip to contentSkip to conversation

Added error coverage to support when launching child process fails.

PATCH Superseded Edwin Plauchu 1 participant 1 message Sep 20, 2016

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Added error coverage to support when launching child process fails.

From: Edwin Plauchu <[email protected]>

[YOCTO #9752]

---
 utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
utils.c +3 -1
index 6991af1..2ebfb04 100644
@@ -249,7 +249,7 @@ run_child(char *run_ptest, int fd_stdout, int fd_stderr)
 	dup2(fd_stderr, STDERR_FILENO);
 	execv(run_ptest, argv);
 
-	exit(0);
+	exit(1);
 }
 
 static inline int
@@ -336,6 +336,7 @@ run_ptests(struct ptest_list *head, int timeout, const char *progname,
 
 			child = fork();
 			if (child == -1) {
+				fprintf(stderr, "ERROR: Fork fatal\n");
 				rc = -1;
 				break;
 			} else if (child == 0) {
@@ -351,6 +352,7 @@ run_ptests(struct ptest_list *head, int timeout, const char *progname,
 				status = wait_child(ptest_dir, p->run_ptest, child,
 						timeout, fds, fps);
 				if (status)
+					fprintf(stderr, "ERROR: Program child error\n");
 					rc += 1;
 
 				fprintf(fp, "END: %s\n", ptest_dir);
Signature · 1 line
2.9.3