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

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

Issue 1176413003: Build ForkWithFlags and part of NamespaceSandbox under nonsfi newlib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « sandbox/linux/services/namespace_sandbox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/services/namespace_sandbox.cc
diff --git a/sandbox/linux/services/namespace_sandbox.cc b/sandbox/linux/services/namespace_sandbox.cc
index 23796446f3044e88a6ddcb5d6e38fb41156e8456..3d10e47cf88f2d584cf311a58ffb9476ef61142e 100644
--- a/sandbox/linux/services/namespace_sandbox.cc
+++ b/sandbox/linux/services/namespace_sandbox.cc
@@ -24,6 +24,7 @@
#include "base/process/process.h"
#include "sandbox/linux/services/credentials.h"
#include "sandbox/linux/services/namespace_utils.h"
+#include "sandbox/linux/system_headers/linux_signal.h"
namespace sandbox {
@@ -65,6 +66,7 @@ void SetEnvironForNamespaceType(base::EnvironmentMap* environ,
// An empty string causes the env var to be unset in the child process.
(*environ)[env_var] = value ? "1" : "";
}
+#endif // !defined(OS_NACL_NONSFI)
// Linux supports up to 64 signals. This should be updated if that ever changes.
int g_signal_exit_codes[64];
@@ -79,7 +81,6 @@ void TerminationSignalHandler(int sig) {
_exit(NamespaceSandbox::kDefaultExitCode);
}
-#endif // !defined(OS_NACL_NONSFI)
} // namespace
@@ -129,11 +130,12 @@ base::Process NamespaceSandbox::LaunchProcess(
return base::LaunchProcess(argv, launch_options);
}
+#endif // !defined(OS_NACL_NONSFI)
// static
pid_t NamespaceSandbox::ForkInNewPidNamespace(bool drop_capabilities_in_child) {
const pid_t pid =
- base::ForkWithFlags(CLONE_NEWPID | SIGCHLD, nullptr, nullptr);
+ base::ForkWithFlags(CLONE_NEWPID | LINUX_SIGCHLD, nullptr, nullptr);
if (pid < 0) {
return pid;
}
@@ -168,10 +170,13 @@ bool NamespaceSandbox::InstallTerminationSignalHandler(
struct sigaction old_action;
PCHECK(sigaction(sig, nullptr, &old_action) == 0);
hidehiko 2015/06/16 05:41:53 Youl'll need to call sys_sigaction instead. Ditto
rickyz (no longer on Chrome) 2015/06/16 20:57:07 Oops, done - do you know whether we need our own d
+#if !defined(OS_NACL_NONSFI)
if (old_action.sa_flags & SA_SIGINFO &&
old_action.sa_sigaction != nullptr) {
return false;
- } else if (old_action.sa_handler != SIG_DFL) {
+ } else
hidehiko 2015/06/16 05:41:53 nit: you don't need "else"
rickyz (no longer on Chrome) 2015/06/16 20:57:06 Done.
+#endif
+ if (old_action.sa_handler != SIG_DFL) {
hidehiko 2015/06/16 05:41:53 SIG_DFL needs to be LINUX_SIG_DFL.
rickyz (no longer on Chrome) 2015/06/16 20:57:06 Done.
return false;
}
@@ -188,7 +193,6 @@ bool NamespaceSandbox::InstallTerminationSignalHandler(
PCHECK(sigaction(sig, &action, nullptr) == 0);
return true;
}
-#endif // !defined(OS_NACL_NONSFI)
// static
bool NamespaceSandbox::InNewUserNamespace() {
« no previous file with comments | « sandbox/linux/services/namespace_sandbox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698