am 021ce40c: am 84d0683a: Fix unistd.getpid_caching_and_clone.

* commit '021ce40c0ca98ccdd7daa4d468222b951da10c06':
  Fix unistd.getpid_caching_and_clone.
This commit is contained in:
Elliott Hughes 2014-08-22 16:53:23 +00:00 committed by Android Git Automerger
commit a657e1cc6a

View File

@ -431,6 +431,10 @@ TEST(unistd, getpid_caching_and_clone) {
void* child_stack[1024]; void* child_stack[1024];
int clone_result = clone(GetPidCachingCloneStartRoutine, &child_stack[1024], CLONE_NEWNS | SIGCHLD, NULL); int clone_result = clone(GetPidCachingCloneStartRoutine, &child_stack[1024], CLONE_NEWNS | SIGCHLD, NULL);
if (clone_result == -1 && errno == EPERM && getuid() != 0) {
GTEST_LOG_(INFO) << "This test only works if you have permission to CLONE_NEWNS; try running as root.\n";
return;
}
ASSERT_NE(clone_result, -1); ASSERT_NE(clone_result, -1);
ASSERT_EQ(parent_pid, getpid()); ASSERT_EQ(parent_pid, getpid());