Use successful_exit() helper for testing system() return value

This commit is contained in:
Andrew Ayer
2014-03-28 13:52:33 -07:00
parent cd5f3534aa
commit df838947a0
2 changed files with 6 additions and 6 deletions

View File

@@ -145,7 +145,7 @@ int exec_command (const char* command, std::ostream& output)
bool successful_exit (int status)
{
return WIFEXITED(status) && WEXITSTATUS(status) == 0;
return status != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0;
}
void open_tempfile (std::fstream& file, std::ios_base::openmode mode)