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

Unified Diff: sandbox/linux/services/namespace_sandbox.h

Issue 1158793003: Enable one PID namespace per process for NaCl processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Get rid of kDefaultExitCode. Created 5 years, 7 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
Index: sandbox/linux/services/namespace_sandbox.h
diff --git a/sandbox/linux/services/namespace_sandbox.h b/sandbox/linux/services/namespace_sandbox.h
index 80097fb16afa625415070e8e581540e514e67abf..474ca6cb554621b820988c0aea4ca71f66118bd8 100644
--- a/sandbox/linux/services/namespace_sandbox.h
+++ b/sandbox/linux/services/namespace_sandbox.h
@@ -18,6 +18,10 @@
namespace sandbox {
+inline int SignalExitCode(int sig) {
jln (very slow on Chromium) 2015/05/28 09:02:33 Let's qualify this in NamespaceSandbox:: as a stat
rickyz (no longer on Chrome) 2015/05/29 23:16:39 Done.
+ return -sig & 0xff;
+}
+
// Helper class for starting a process inside a new user, PID, and network
// namespace. Before using a namespace sandbox, check for namespaces support
// using Credentials::CanCreateProcessInNewUserNS.
@@ -38,8 +42,6 @@ namespace sandbox {
class SANDBOX_EXPORT NamespaceSandbox {
public:
#if !defined(OS_NACL_NONSFI)
- static const int kDefaultExitCode = 1;
-
// Launch a new process inside its own user/PID/network namespaces (depending
// on kernel support). Requires at a minimum that user namespaces are
// supported (use Credentials::CanCreateProcessInNewUserNS to check this).
@@ -70,8 +72,8 @@ class SANDBOX_EXPORT NamespaceSandbox {
//
// SIGHUP, SIGINT, SIGABRT, SIGQUIT, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2
//
- // that exits with kDefaultExitCode. These are signals whose default action is
- // to terminate the program (apart from SIGILL, SIGFPE, and SIGSEGV, which
+ // that exits with SignalExitCode(sig). These are signals whose default action
+ // is to terminate the program (apart from SIGILL, SIGFPE, and SIGSEGV, which
// will still terminate the process if e.g. an illegal instruction is
// encountered, etc.).
//

Powered by Google App Engine
This is Rietveld 408576698