Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Unified Diff: third_party/crashpad/crashpad/util/posix/process_info_linux.cc

Issue 2814043003: Update Crashpad to 1f28a123a4c9449e3d7ddad4ff00dacd366d5216 (Closed)
Patch Set: Add missing GN config to fix compile/link. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/crashpad/crashpad/util/posix/process_info_linux.cc
diff --git a/third_party/crashpad/crashpad/util/posix/process_info_linux.cc b/third_party/crashpad/crashpad/util/posix/process_info_linux.cc
index bd4202a8801d0f81ea852466f53fd7adcfd108a2..13b15a0dfc42fed070e51dabc7a223c5f8b64015 100644
--- a/third_party/crashpad/crashpad/util/posix/process_info_linux.cc
+++ b/third_party/crashpad/crashpad/util/posix/process_info_linux.cc
@@ -21,7 +21,6 @@
#include <sys/ptrace.h>
#include <sys/uio.h>
#include <sys/user.h>
-#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
@@ -33,6 +32,7 @@
#include "base/strings/string_piece.h"
#include "util/file/delimited_file_reader.h"
#include "util/file/file_reader.h"
+#include "util/linux/scoped_ptrace_attach.h"
namespace crashpad {
@@ -107,21 +107,6 @@ void TimespecToTimeval(const timespec& ts, timeval* tv) {
tv->tv_usec = ts.tv_nsec / 1000;
}
-class ScopedPtraceDetach {
- public:
- explicit ScopedPtraceDetach(pid_t pid) : pid_(pid) {}
- ~ScopedPtraceDetach() {
- if (ptrace(PTRACE_DETACH, pid_, nullptr, nullptr) != 0) {
- PLOG(ERROR) << "ptrace";
- }
- }
-
- private:
- pid_t pid_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedPtraceDetach);
-};
-
} // namespace
ProcessInfo::ProcessInfo()
@@ -330,15 +315,8 @@ bool ProcessInfo::Is64Bit(bool* is_64_bit) const {
if (pid_ == getpid()) {
is_64_bit_ = am_64_bit;
} else {
- if (ptrace(PTRACE_ATTACH, pid_, nullptr, nullptr) != 0) {
- PLOG(ERROR) << "ptrace";
- return false;
- }
-
- ScopedPtraceDetach ptrace_detach(pid_);
-
- if (HANDLE_EINTR(waitpid(pid_, nullptr, __WALL)) < 0) {
- PLOG(ERROR) << "waitpid";
+ ScopedPtraceAttach ptrace_attach;
+ if (!ptrace_attach.ResetAttach(pid_)) {
return false;
}
« no previous file with comments | « third_party/crashpad/crashpad/util/posix/close_multiple.cc ('k') | third_party/crashpad/crashpad/util/posix/scoped_dir.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698