Skip to content

Commit b26e10d

Browse files
committed
Add test files
1 parent d512eb4 commit b26e10d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/fs/test_enotdir.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <errno.h>
2+
#include <fcntl.h>
3+
#include <stdio.h>
4+
#include <string.h>
5+
#include <unistd.h>
6+
#include <sys/stat.h>
7+
8+
int main() {
9+
{
10+
int src_fd = open("file", O_CREAT | O_WRONLY, 0777);
11+
close(src_fd);
12+
}
13+
{
14+
int target_fd = mkdir("file/blah", 0777);
15+
printf("target_fd: %d, errno: %d %s\n", target_fd, errno, strerror(errno));
16+
}
17+
}

test/fs/test_enotdir.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_fd: -1, errno: 54 Not a directory

0 commit comments

Comments
 (0)