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

Unified Diff: base/process/kill_mac.cc

Issue 197873014: Revert of Implement ScopedFD in terms of ScopedGeneric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « base/posix/unix_domain_socket_linux_unittest.cc ('k') | base/process/kill_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/kill_mac.cc
diff --git a/base/process/kill_mac.cc b/base/process/kill_mac.cc
index 1589a641a0484c000b243578a6cb94884e44c158..5ebca5d00762329f5a163a9c8e2878df748f50f6 100644
--- a/base/process/kill_mac.cc
+++ b/base/process/kill_mac.cc
@@ -10,7 +10,6 @@
#include <sys/wait.h>
#include "base/file_util.h"
-#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
@@ -77,13 +76,15 @@
int result;
- ScopedFD kq(HANDLE_EINTR(kqueue()));
- if (!kq.is_valid()) {
+ int kq = HANDLE_EINTR(kqueue());
+ if (kq == -1) {
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.get(), &change, 1, NULL, 0, NULL));
+ result = HANDLE_EINTR(kevent(kq, &change, 1, NULL, 0, NULL));
if (result == -1) {
if (errno != ESRCH) {
@@ -119,7 +120,7 @@
struct kevent event = {0};
while (remaining_delta.InMilliseconds() > 0) {
const struct timespec remaining_timespec = remaining_delta.ToTimeSpec();
- result = kevent(kq.get(), NULL, 0, &event, 1, &remaining_timespec);
+ result = kevent(kq, NULL, 0, &event, 1, &remaining_timespec);
if (result == -1 && errno == EINTR) {
remaining_delta = deadline - TimeTicks::Now();
result = 0;
« no previous file with comments | « base/posix/unix_domain_socket_linux_unittest.cc ('k') | base/process/kill_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698