summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-28 01:37:23 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-28 01:37:23 +0000
commit140a7cd1d47292be7c5872c6019c1ab09af774e3 (patch)
tree5210806d7de816fa0025952e20bf6396b1c0d9fb /chrome/browser/browser_main.cc
parenta7c2ff748541a96df53995216dc2a7c1209dca48 (diff)
downloadchromium_src-140a7cd1d47292be7c5872c6019c1ab09af774e3.zip
chromium_src-140a7cd1d47292be7c5872c6019c1ab09af774e3.tar.gz
chromium_src-140a7cd1d47292be7c5872c6019c1ab09af774e3.tar.bz2
POSIX: don't spawn zombies.
http://codereview.chromium.org/93147 BUG=9401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index d687acb..a2a5530 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.