Throw Exception in the case the child was STOPped or CONTinued.
Document that system(3) should handle those cases.
#include <sys/wait.h>
+#include <cassert>
#include <iostream>
#include <client/snapper/cmd.h>
if (exit_status != 0) {
SN_THROW(CommandException(exit_status));
}
- } else {
+ } else if (WIFSIGNALED(status)) {
SN_THROW(Exception(sformat("%s killed with %d", command.c_str(), WTERMSIG(status))));
+ } else {
+ // For system(3), only WIFEXITED or WIFSIGNALED should be possible.
+ string error = sformat(_("%s got STOP or CONT signal and may still be running"),
+ command.c_str());
+ SN_THROW(Exception(error));
}
} break;
}