Skip to content
Snippets Groups Projects
Verified Commit 5d70c5cb authored by Dorian Stoll's avatar Dorian Stoll
Browse files

ema-measure: Pass through the exit code of the wrapped program

parent 29de9549
No related branches found
No related tags found
No related merge requests found
......@@ -29,12 +29,15 @@ int main(int argc, char **argv)
if (pid == 0)
execvp(argv[1], &argv[1]);
ret = waitpid(pid, NULL, 0);
int status = 0;
ret = waitpid(pid, &status, 0);
if (ret == -1) {
perror("Waiting for child process failed");
return EXIT_FAILURE;
}
EMA_region_end(region);
ret = EMA_finalize();
......@@ -43,5 +46,8 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
if (!WIFEXITED(status))
return EXIT_FAILURE;
return WEXITSTATUS(status);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment