From a9791f1438a47bbb3a336e0fbdfff2e1d28a8da3 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 22 Nov 2024 17:44:29 +0100 Subject: [gdb] Use gdb::waitpid more often Use gdb::waitpid instead of plain waitpid, making sure that EINTR is handled. Tested on x86_64-linux. --- gdb/netbsd-nat.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'gdb/netbsd-nat.c') diff --git a/gdb/netbsd-nat.c b/gdb/netbsd-nat.c index 90456de..5005cb8 100644 --- a/gdb/netbsd-nat.c +++ b/gdb/netbsd-nat.c @@ -25,6 +25,7 @@ #include "inferior.h" #include "gdbarch.h" #include "gdbsupport/buildargv.h" +#include "gdbsupport/eintr.h" #include #include @@ -547,12 +548,8 @@ nbsd_wait (ptid_t ptid, struct target_waitstatus *ourstatus, set_sigint_trap (); - do - { - /* The common code passes WNOHANG that leads to crashes, overwrite it. */ - pid = waitpid (ptid.pid (), &status, 0); - } - while (pid == -1 && errno == EINTR); + /* The common code passes WNOHANG that leads to crashes, overwrite it. */ + pid = gdb::waitpid (ptid.pid (), &status, 0); clear_sigint_trap (); -- cgit v1.1