1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-10-27 20:34:20 +00:00

better message on execl failure

This commit is contained in:
Oliver Giles 2015-12-06 12:41:38 +01:00
parent e7fe117426
commit 1eb6a9138e

View File

@ -101,9 +101,10 @@ bool Run::step() {
for(auto& pair : params) { for(auto& pair : params) {
setenv(pair.first.c_str(), pair.second.c_str(), false); setenv(pair.first.c_str(), pair.second.c_str(), false);
} }
printf("[laminar] Executing %s\n", currentScript.c_str()); fprintf(stderr, "[laminar] Executing %s\n", currentScript.c_str());
execl(currentScript.c_str(), currentScript.c_str(), NULL); execl(currentScript.c_str(), currentScript.c_str(), NULL);
LLOG(FATAL, "execl returned", strerror(errno)); // cannot use LLOG because stdout/stderr are captured
fprintf(stderr, "[laminar] Failed to execute %s\n", currentScript.c_str());
_exit(1); _exit(1);
} }