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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 879303004: Non-SFI mode: Use dummy PID for NaCl's IPC channel for nacl_helper_nonsfi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « ipc/ipc_channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix.cc
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 6ba1f607b3d000b0619b8d77b994ce646c205007..6d8484d22f6f99422c7f582a36bef0c6c62800f1 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -773,14 +773,20 @@ void ChannelPosix::ClosePipeOnError() {
}
int ChannelPosix::GetHelloMessageProcId() const {
+#if defined(OS_NACL_NONSFI)
+ // In nacl_helper_nonsfi, getpid() invoked by GetCurrentProcId() is not
+ // allowed and would cause a SIGSYS crashing because of the seccomp sandbox.
dmichael (off chromium) 2015/02/02 23:43:38 s/crashing/crash
hidehiko 2015/02/03 04:53:13 Done.
+ return -1;
+#else
int pid = base::GetCurrentProcId();
#if defined(OS_LINUX)
// Our process may be in a sandbox with a separate PID namespace.
if (global_pid_) {
pid = global_pid_;
}
-#endif
+#endif // defined(OS_LINUX)
return pid;
+#endif // defined(OS_NACL_NONSFI)
}
void ChannelPosix::QueueHelloMessage() {
« no previous file with comments | « ipc/ipc_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698