Chromium Code Reviews| Index: sandbox/linux/services/credentials.cc |
| diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc |
| index e571ddec59776a58a1810b22bf83ba4c63b8ba58..3762106aa18c2b7ab3089d75f6068c19658b9712 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 kExitSuccess == status; |
| + return WIFEXITED(status) && WEXITSTATUS(status) == kExitSuccess; |
|
jln (very slow on Chromium)
2015/02/19 03:59:59
ugh, thanks :/
|
| } |
| // CHECK() that an attempt to move to a new user namespace raised an expected |
| @@ -178,8 +178,10 @@ bool Credentials::CanCreateProcessInNewUserNS() { |
| } |
| // Always reap the child. |
| - siginfo_t infop; |
| - PCHECK(0 == HANDLE_EINTR(waitid(P_PID, pid, &infop, WEXITED))); |
| + int status = -1; |
| + PCHECK(HANDLE_EINTR(waitpid(pid, &status, 0)) == pid); |
| + CHECK(WIFEXITED(status)); |
| + CHECK_EQ(0, WEXITSTATUS(status)); |
|
jln (very slow on Chromium)
2015/02/19 03:59:59
Since you're now checking the exit code, do you wa
mdempsky
2015/02/19 04:02:51
Done.
|
| // clone(2) succeeded, we can use CLONE_NEWUSER. |
| return true; |