diff options
author | Tom de Vries <tdevries@suse.de> | 2024-11-22 17:44:29 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-11-22 17:44:29 +0100 |
commit | a9791f1438a47bbb3a336e0fbdfff2e1d28a8da3 (patch) | |
tree | 76ac04426248d3a65bf89adef08bacb4c8a4272e /gdb/netbsd-nat.c | |
parent | 658a03e9e85698fa8815915d1a858371ea51da83 (diff) | |
download | binutils-a9791f1438a47bbb3a336e0fbdfff2e1d28a8da3.zip binutils-a9791f1438a47bbb3a336e0fbdfff2e1d28a8da3.tar.gz binutils-a9791f1438a47bbb3a336e0fbdfff2e1d28a8da3.tar.bz2 |
[gdb] Use gdb::waitpid more often
Use gdb::waitpid instead of plain waitpid, making sure that EINTR is handled.
Tested on x86_64-linux.
Diffstat (limited to 'gdb/netbsd-nat.c')
-rw-r--r-- | gdb/netbsd-nat.c | 9 |
1 files changed, 3 insertions, 6 deletions
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 <sys/types.h> #include <sys/ptrace.h> @@ -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 (); |