4 ms·
When I first learned of this behavior, I immediately replaced all calls to fork() with calls to the following throughout our entire codebase: int checked_f
by usefulcat 7y ago
When I first learned of this behavior, I immediately replaced all calls to fork() with calls to the following throughout our entire codebase:
int checked_fork() {
const int pid = fork();
if (pid < 0) {
throw std::runtime_error("fork failed");
}
return pid;
}
- thestoicattack 7y agoDid you detect any crashes after the change?