Index: chrome/browser/browser_main.cc |
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc |
index d687acbba459efa31ecb6333ff2173a829c46591..a2a5530f5dad29fed01b87a3b7a245ac25b82126 100644 |
--- a/chrome/browser/browser_main.cc |
+++ b/chrome/browser/browser_main.cc |
@@ -56,6 +56,7 @@ |
// TODO(port): get rid of this include. It's used just to provide declarations |
// and stub definitions for classes we encouter during the porting effort. |
#include "chrome/common/temp_scaffolding_stubs.h" |
+#include <signal.h> |
#endif |
// TODO(port): several win-only methods have been pulled out of this, but |
@@ -180,6 +181,12 @@ void RunUIMessageLoop(BrowserProcess* browser_process) { |
#endif |
} |
+#if defined(OS_POSIX) |
+// See comment below, where sigaction is called. |
+void SIGCHLDHandler(int signal) { |
+} |
+#endif |
+ |
} // namespace |
// Main routine for running as the Browser process. |
@@ -201,6 +208,14 @@ int BrowserMain(const MainFunctionParams& parameters) { |
tracked_objects::AutoTracking tracking_objects; |
#endif |
+#if defined(OS_POSIX) |
+ // We need to accept SIGCHLD, even though our handler is a no-op because |
+ // otherwise we cannot wait on children. (According to POSIX 2001.) |
+ struct sigaction action = {0}; |
+ action.sa_handler = SIGCHLDHandler; |
+ CHECK(sigaction(SIGCHLD, &action, NULL) == 0); |
+#endif |
+ |
// Do platform-specific things (such as finishing initializing Cocoa) |
// prior to instantiating the message loop. This could be turned into a |
// broadcast notification. |