Merge "Fix unistd.execvpe_ENOEXEC and unistd.execvpe_failure."

This commit is contained in:
Treehugger Robot 2016-12-02 02:59:33 +00:00 committed by Gerrit Code Review
commit b2d36b4ec7
1 changed files with 4 additions and 3 deletions

View File

@ -1347,7 +1347,8 @@ TEST(UNISTD_TEST, execvpe_failure) {
ExecTestHelper eth;
errno = 0;
ASSERT_EQ(-1, execvpe("this-does-not-exist", eth.GetArgs(), eth.GetEnv()));
ASSERT_EQ(ENOENT, errno);
// Running in CTS we might not even be able to search all directories in $PATH.
ASSERT_TRUE(errno == ENOENT || errno == EACCES);
}
TEST(UNISTD_TEST, execvpe) {
@ -1380,8 +1381,8 @@ TEST(UNISTD_TEST, execvpe_ENOEXEC) {
ASSERT_EQ(-1, execvpe(basename(tf.filename), eth.GetArgs(), eth.GetEnv()));
ASSERT_EQ(EACCES, errno);
// Make it executable.
ASSERT_EQ(0, chmod(tf.filename, 0555));
// Make it executable (and keep it writable because we're going to rewrite it below).
ASSERT_EQ(0, chmod(tf.filename, 0777));
// TemporaryFile will have a writable fd, so we can test ETXTBSY while we're here...
errno = 0;