Skip to content

Commit 08a4077

Browse files
committed
Make the child process that failed to execvp exit
Previously the zombie child would continue on the same code path as the forking parent. Hence one would see spurious "Remove failed" message as the zombie child would try to perform the same file removal as the parent.
1 parent 4928f69 commit 08a4077

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

regression/goto-gcc/run_diagnostic/test.desc

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ main.i
55
^SIGNAL=0$
66
^execvp /no/such/tool failed: No such file or directory$
77
--
8+
^Remove failed
89
^warning: ignoring
910
^CONVERSION ERROR$

src/util/run.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ int run(
133133

134134
/* usually no return */
135135
perror(std::string("execvp "+what+" failed").c_str());
136-
return 1;
136+
exit(1);
137137
}
138138
else /* fork() returns new pid to the parent process */
139139
{

0 commit comments

Comments
 (0)