Skip to content

Commit

Permalink
Fail fast in case of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
i-ky committed Feb 8, 2023
1 parent 961c607 commit bfbcbf4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/basset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ int main(int argc, char *argv[]) {

if (ptrace(PTRACE_SYSCALL, pid, nullptr, nullptr) == -1) {
perror("cannot ptrace(PTRACE_CONT)");
return -1;
}

while (auto pid = wait(&wstatus)) {
Expand Down Expand Up @@ -86,6 +87,7 @@ int main(int argc, char *argv[]) {

if (ptrace(PTRACE_SYSCALL, pid, nullptr, nullptr) == -1) {
perror("cannot ptrace(PTRACE_SYSCALL)");
return -1;
}
} else if (WIFCONTINUED(wstatus)) {
cerr << pid << " continued\n";
Expand Down

0 comments on commit bfbcbf4

Please sign in to comment.