Skip to content

Commit

Permalink
Linux: init_process_reaper comment cleanup.
Browse files Browse the repository at this point in the history
Cleanup a few comments in init_process_reaper.cc

BUG=312380

Review URL: https://codereview.chromium.org/92963002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237723 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jln@chromium.org committed Nov 28, 2013
1 parent b100499 commit a96e2b8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions sandbox/linux/services/init_process_reaper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ bool CreateInitProcessReaper(base::Closure* post_fork_parent_callback) {
PLOG(ERROR) << "Failed to create socketpair";
return false;
}
// We use normal fork, not the ForkDelegate in this case since we are not a
// true Zygote yet.
pid_t child_pid = fork();
if (child_pid == -1) {
int close_ret;
Expand All @@ -42,7 +40,7 @@ bool CreateInitProcessReaper(base::Closure* post_fork_parent_callback) {
return false;
}
if (child_pid) {
// We are the parent, assuming the role of an init process.
// In the parent, assuming the role of an init process.
// The disposition for SIGCHLD cannot be SIG_IGN or wait() will only return
// once all of our childs are dead. Since we're init we need to reap childs
// as they come.
Expand Down Expand Up @@ -76,14 +74,14 @@ bool CreateInitProcessReaper(base::Closure* post_fork_parent_callback) {
if (reaped_child_info.si_code == CLD_EXITED) {
exit_code = reaped_child_info.si_status;
}
// Exit with the same exit code as our parent. This is most likely
// useless. _exit with 0 if we got signaled.
// Exit with the same exit code as our parent. Exit with 0 if we got
// signaled.
_exit(exit_code);
}
}
} else {
// The child needs to wait for the parent to close kZygoteIdFd to avoid a
// race condition
// The child needs to wait for the parent to run the callback to avoid a
// race condition.
int close_ret;
close_ret = HANDLE_EINTR(close(sync_fds[1]));
DPCHECK(!close_ret);
Expand Down

0 comments on commit a96e2b8

Please sign in to comment.