Skip to content

Commit 2b1ed5f

Browse files
committed
selftests/nolibc: create /dev/full when running as PID 1
An upcoming testcase will use /dev/full. Make sure it is always present. Signed-off-by: Thomas Weißschuh <[email protected]> Acked-by: Willy Tarreau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 7c02bc4 commit 2b1ed5f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/testing/selftests/nolibc/nolibc-test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,12 +1778,14 @@ int prepare(void)
17781778
if (stat("/dev/.", &stat_buf) == 0 || mkdir("/dev", 0755) == 0) {
17791779
if (stat("/dev/console", &stat_buf) != 0 ||
17801780
stat("/dev/null", &stat_buf) != 0 ||
1781-
stat("/dev/zero", &stat_buf) != 0) {
1781+
stat("/dev/zero", &stat_buf) != 0 ||
1782+
stat("/dev/full", &stat_buf) != 0) {
17821783
/* try devtmpfs first, otherwise fall back to manual creation */
17831784
if (mount("/dev", "/dev", "devtmpfs", 0, 0) != 0) {
17841785
mknod("/dev/console", 0600 | S_IFCHR, makedev(5, 1));
17851786
mknod("/dev/null", 0666 | S_IFCHR, makedev(1, 3));
17861787
mknod("/dev/zero", 0666 | S_IFCHR, makedev(1, 5));
1788+
mknod("/dev/full", 0666 | S_IFCHR, makedev(1, 7));
17871789
}
17881790
}
17891791
}

0 commit comments

Comments
 (0)