diff options
| author | Michal Gorny <mgorny@gentoo.org> | 2019-03-21 19:35:55 +0000 |
|---|---|---|
| committer | Michal Gorny <mgorny@gentoo.org> | 2019-03-21 19:35:55 +0000 |
| commit | 2819136f0a3d75f3b6fefe5f962efdbf66e99c12 (patch) | |
| tree | daa3971def7f0d9e8d59169ca53d594b2940e62b /lldb/source/Plugins/Process/Linux | |
| parent | c56872589f1593eb0e6ccd9ee2c3e1be0c947e08 (diff) | |
| download | bcm5719-llvm-2819136f0a3d75f3b6fefe5f962efdbf66e99c12.tar.gz bcm5719-llvm-2819136f0a3d75f3b6fefe5f962efdbf66e99c12.zip | |
[lldb] Add missing EINTR handling
Differential Revision: https://reviews.llvm.org/D59606
llvm-svn: 356703
Diffstat (limited to 'lldb/source/Plugins/Process/Linux')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp index 01d8ef9d33a..bd1f099f5d4 100644 --- a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp +++ b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp @@ -51,8 +51,10 @@ struct ChildDeleter { ~ChildDeleter() { int status; - kill(pid, SIGKILL); // Kill the child. - waitpid(pid, &status, __WALL); // Pick up the remains. + // Kill the child. + kill(pid, SIGKILL); + // Pick up the remains. + llvm::sys::RetryAfterSignal(-1, waitpid, pid, &status, __WALL); } }; @@ -81,7 +83,8 @@ bool WorkaroundNeeded() { } int status; - ::pid_t wpid = waitpid(child_pid, &status, __WALL); + ::pid_t wpid = llvm::sys::RetryAfterSignal(-1, waitpid, + child_pid, &status, __WALL); if (wpid != child_pid || !WIFSTOPPED(status)) { LLDB_LOG(log, "waitpid() failed (status = {0:x}): {1}", status, Status(errno, eErrorTypePOSIX)); @@ -110,7 +113,8 @@ bool WorkaroundNeeded() { break; } - wpid = waitpid(child_pid, &status, __WALL); + wpid = llvm::sys::RetryAfterSignal(-1, waitpid, + child_pid, &status, __WALL); if (wpid != child_pid || !WIFSTOPPED(status)) { LLDB_LOG(log, "waitpid() failed (status = {0:x}): {1}", status, Status(errno, eErrorTypePOSIX)); |

