diff options
-rw-r--r-- | rvnit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rvnit.c b/rvnit.c index 268013a..816b6f9 100644 --- a/rvnit.c +++ b/rvnit.c @@ -647,12 +647,14 @@ mounted(const char *dir) void init_mount() { #ifdef __linux__ - LOG("init_mount"); + if (!access("/dev/null", F_OK) && !mounted("/dev")) { + LOG("mounting /dev"); + mount("dev", "/dev", "devtmpfs", MS_NOSUID, "mode=0755"); + } if (!mounted("/run")) { LOG("mounting /run"); mount("run", "/run", "tmpfs", MS_NOSUID|MS_NODEV, "mode=0755"); } - LOG("init_mount done"); #endif } @@ -702,7 +704,7 @@ main(int argc, char *argv[]) #endif } - nullfd = open("/dev/nullz", O_RDONLY | O_CLOEXEC); + nullfd = open("/dev/null", O_RDONLY | O_CLOEXEC); if (nullfd < 0) { perror("rvnit: open /dev/null"); |