Emulate ENOTDIR better

This commit is contained in:
Justine Tunney 2023-08-16 20:11:19 -07:00
parent b76b2be2d0
commit 8d1c81ac9f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
35 changed files with 80 additions and 50 deletions

View file

@ -47,6 +47,9 @@ TEST(open, enoent) {
TEST(open, enotdir) {
ASSERT_SYS(0, 0, touch("o", 0644));
ASSERT_SYS(ENOTDIR, -1, open("o/", O_RDONLY));
ASSERT_SYS(ENOTDIR, -1, open("o/.", O_RDONLY));
ASSERT_SYS(ENOTDIR, -1, open("o/./", O_RDONLY));
ASSERT_SYS(ENOTDIR, -1, open("o/doesnotexist", O_RDONLY));
}