| Index: base/process/kill_mac.cc
|
| diff --git a/base/process/kill_mac.cc b/base/process/kill_mac.cc
|
| index 5ebca5d00762329f5a163a9c8e2878df748f50f6..f5ac6592471b64d12d1b13e91dd3c6d76bff45e1 100644
|
| --- a/base/process/kill_mac.cc
|
| +++ b/base/process/kill_mac.cc
|
| @@ -76,15 +76,13 @@ void WaitForChildToDie(pid_t child, int timeout) {
|
|
|
| int result;
|
|
|
| - int kq = HANDLE_EINTR(kqueue());
|
| - if (kq == -1) {
|
| + ScopedFD kq(HANDLE_EINTR(kqueue()));
|
| + if (!kq) {
|
| DPLOG(ERROR) << "kqueue()";
|
| } else {
|
| - file_util::ScopedFD auto_close_kq(&kq);
|
| -
|
| struct kevent change = {0};
|
| EV_SET(&change, child, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL);
|
| - result = HANDLE_EINTR(kevent(kq, &change, 1, NULL, 0, NULL));
|
| + result = HANDLE_EINTR(kevent(kq.get(), &change, 1, NULL, 0, NULL));
|
|
|
| if (result == -1) {
|
| if (errno != ESRCH) {
|
| @@ -120,7 +118,7 @@ void WaitForChildToDie(pid_t child, int timeout) {
|
| struct kevent event = {0};
|
| while (remaining_delta.InMilliseconds() > 0) {
|
| const struct timespec remaining_timespec = remaining_delta.ToTimeSpec();
|
| - result = kevent(kq, NULL, 0, &event, 1, &remaining_timespec);
|
| + result = kevent(kq.get(), NULL, 0, &event, 1, &remaining_timespec);
|
| if (result == -1 && errno == EINTR) {
|
| remaining_delta = deadline - TimeTicks::Now();
|
| result = 0;
|
|
|