OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/zygote_host_linux.h" | 5 #include "content/browser/zygote_host_linux.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 base::TerminationStatus status; | 224 base::TerminationStatus status; |
225 int exit_code; | 225 int exit_code; |
226 if (g_suid_sandbox_active) | 226 if (g_suid_sandbox_active) |
227 child = real_pids_to_sandbox_pids[child]; | 227 child = real_pids_to_sandbox_pids[child]; |
228 if (child) { | 228 if (child) { |
229 status = base::GetTerminationStatus(child, &exit_code); | 229 status = base::GetTerminationStatus(child, &exit_code); |
230 } else { | 230 } else { |
231 // Assume that if we can't find the child in the sandbox, then | 231 // Assume that if we can't find the child in the sandbox, then |
232 // it terminated normally. | 232 // it terminated normally. |
233 status = base::TERMINATION_STATUS_NORMAL_TERMINATION; | 233 status = base::TERMINATION_STATUS_NORMAL_TERMINATION; |
234 exit_code = ResultCodes::NORMAL_EXIT; | 234 exit_code = content::RESULT_CODE_NORMAL_EXIT; |
235 } | 235 } |
236 | 236 |
237 Pickle write_pickle; | 237 Pickle write_pickle; |
238 write_pickle.WriteInt(static_cast<int>(status)); | 238 write_pickle.WriteInt(static_cast<int>(status)); |
239 write_pickle.WriteInt(exit_code); | 239 write_pickle.WriteInt(exit_code); |
240 ssize_t written = | 240 ssize_t written = |
241 HANDLE_EINTR(write(fd, write_pickle.data(), write_pickle.size())); | 241 HANDLE_EINTR(write(fd, write_pickle.data(), write_pickle.size())); |
242 if (written != static_cast<ssize_t>(write_pickle.size())) | 242 if (written != static_cast<ssize_t>(write_pickle.size())) |
243 PLOG(ERROR) << "write"; | 243 PLOG(ERROR) << "write"; |
244 } | 244 } |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 VLOG(1) << "Enabling experimental Seccomp sandbox."; | 757 VLOG(1) << "Enabling experimental Seccomp sandbox."; |
758 sandbox_flags |= ZygoteHost::kSandboxSeccomp; | 758 sandbox_flags |= ZygoteHost::kSandboxSeccomp; |
759 } | 759 } |
760 } | 760 } |
761 #endif // SECCOMP_SANDBOX | 761 #endif // SECCOMP_SANDBOX |
762 | 762 |
763 Zygote zygote(sandbox_flags); | 763 Zygote zygote(sandbox_flags); |
764 // This function call can return multiple times, once per fork(). | 764 // This function call can return multiple times, once per fork(). |
765 return zygote.ProcessRequests(); | 765 return zygote.ProcessRequests(); |
766 } | 766 } |
OLD | NEW |