| Index: sandbox/linux/services/credentials.cc
|
| diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
|
| index ed21fd192bd0c7eda1ffaadcbf6583c26f18751d..e571ddec59776a58a1810b22bf83ba4c63b8ba58 100644
|
| --- a/sandbox/linux/services/credentials.cc
|
| +++ b/sandbox/linux/services/credentials.cc
|
| @@ -114,7 +114,7 @@ bool ChrootToSafeEmptyDir() {
|
| int status = -1;
|
| PCHECK(HANDLE_EINTR(waitpid(pid, &status, 0)) == pid);
|
|
|
| - return WIFEXITED(status) && WEXITSTATUS(status) == kExitSuccess;
|
| + return kExitSuccess == status;
|
| }
|
|
|
| // CHECK() that an attempt to move to a new user namespace raised an expected
|
| @@ -174,14 +174,12 @@ bool Credentials::CanCreateProcessInNewUserNS() {
|
| // have disappeared. Make sure to not do anything in the child, as this is a
|
| // fragile execution environment.
|
| if (pid == 0) {
|
| - _exit(kExitSuccess);
|
| + _exit(0);
|
| }
|
|
|
| // Always reap the child.
|
| - int status = -1;
|
| - PCHECK(HANDLE_EINTR(waitpid(pid, &status, 0)) == pid);
|
| - CHECK(WIFEXITED(status));
|
| - CHECK_EQ(kExitSuccess, WEXITSTATUS(status));
|
| + siginfo_t infop;
|
| + PCHECK(0 == HANDLE_EINTR(waitid(P_PID, pid, &infop, WEXITED)));
|
|
|
| // clone(2) succeeded, we can use CLONE_NEWUSER.
|
| return true;
|
|
|