From bfbcbf4df11e9f2305c9ad1f3102fcd8347b6f5f Mon Sep 17 00:00:00 2001 From: i-ky Date: Wed, 8 Feb 2023 07:14:10 +0000 Subject: [PATCH] Fail fast in case of errors --- src/basset.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/basset.cpp b/src/basset.cpp index d30608c..9945fd5 100644 --- a/src/basset.cpp +++ b/src/basset.cpp @@ -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)) { @@ -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";