startProcess: Make writing error messages from the child more robust

This commit is contained in:
Eelco Dolstra 2014-07-23 19:11:26 +02:00
parent 5989966ed3
commit fdee1ced43

View file

@ -854,8 +854,10 @@ pid_t startProcess(std::function<void()> fun, const string & errorPrefix)
restoreAffinity();
fun();
} catch (std::exception & e) {
writeToStderr(errorPrefix + string(e.what()) + "\n");
}
try {
std::cerr << errorPrefix << e.what() << "\n";
} catch (...) { }
} catch (...) { }
_exit(1);
}