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/utils.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/utils.c')
-rw-r--r-- | gdb/utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 2932efc..bd3a1f1 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -81,6 +81,7 @@ #include "pager.h" #include "run-on-main-thread.h" #include "gdbsupport/gdb_tilde_expand.h" +#include "gdbsupport/eintr.h" void (*deprecated_error_begin_hook) (void); @@ -3483,7 +3484,7 @@ wait_to_die_with_timeout (pid_t pid, int *status, int timeout) alarm (timeout); #endif - waitpid_result = waitpid (pid, status, 0); + waitpid_result = gdb::waitpid (pid, status, 0); #ifdef SIGALRM alarm (0); @@ -3495,7 +3496,7 @@ wait_to_die_with_timeout (pid_t pid, int *status, int timeout) #endif } else - waitpid_result = waitpid (pid, status, WNOHANG); + waitpid_result = gdb::waitpid (pid, status, WNOHANG); if (waitpid_result == pid) return pid; |