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

Unified Diff: chrome/common/process_watcher_mac.cc

Issue 542042: Mac: ensure child processes are properly reaped -- eliminate Helper zombies. (Closed)
Patch Set: Added test. Created 10 years, 11 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 | « no previous file | chrome/common/process_watcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/process_watcher_mac.cc
diff --git a/chrome/common/process_watcher_mac.cc b/chrome/common/process_watcher_mac.cc
index 2d5d185dc55bba513ccdafa3bb091e0024d349ca..be5b9f7337532fe63e20994247879cb9a8fb608d 100644
--- a/chrome/common/process_watcher_mac.cc
+++ b/chrome/common/process_watcher_mac.cc
@@ -42,7 +42,9 @@ void WaitForChildToDie(pid_t child, unsigned timeout) {
int result = HANDLE_EINTR(kevent(kq, &event_to_add, 1, NULL, 0, NULL));
if (result == -1 && errno == ESRCH) {
// A "No Such Process" error is fine, the process may have died already
- // and been reaped by someone else.
+ // and been reaped by someone else. But make sure that it was/is reaped.
+ // Don't report an error in case it was already reaped.
+ HANDLE_EINTR(waitpid(child, NULL, WNOHANG));
return;
}
« no previous file with comments | « no previous file | chrome/common/process_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698