diff options
author | dzwdz | 2022-07-26 20:40:29 +0200 |
---|---|---|
committer | dzwdz | 2022-07-26 20:44:29 +0200 |
commit | 599c916d4cdd06765e0869b0a4d685820384f500 (patch) | |
tree | 7355c35189a4b6e92249f59c76e6d89d5b432f29 /src/user/app/init/main.c | |
parent | 350124fb4cfefc90c8f4a60de3da3c5d7da44f01 (diff) |
user: posix-compatible FILE* opening
Diffstat (limited to 'src/user/app/init/main.c')
-rw-r--r-- | src/user/app/init/main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/user/app/init/main.c b/src/user/app/init/main.c index a898844..71220af 100644 --- a/src/user/app/init/main.c +++ b/src/user/app/init/main.c @@ -15,7 +15,7 @@ __attribute__((section(".text.startup"))) int main(void) { elf_selfreloc(); - file_reopen(stdout, "/kdev/com1", 0); + freopen("/kdev/com1", "a+", stdout); printf("in init (stage 2), loaded at 0x%x\n", &_image_base); MOUNT("/tmp/", tmpfs_drv()); @@ -42,11 +42,11 @@ int main(void) { } if (!fork()) { - if (!file_reopen(stdout, "/kdev/com1", 0)) { + if (!freopen("/kdev/com1", "a+", stdout)) { printf("couldn't open /kdev/com1\n"); // TODO borked _syscall_exit(1); } - if (!file_reopen(stdin, "/kdev/com1", 0)) { + if (!freopen("/kdev/com1", "r", stdin)) { printf("couldn't open /kdev/com1\n"); _syscall_exit(1); } @@ -57,11 +57,11 @@ int main(void) { } if (!fork()) { - if (!file_reopen(stdout, "/vga_tty", 0)) { + if (!freopen("/vga_tty", "a+", stdout)) { printf("couldn't open /vga_tty\n"); // TODO borked _syscall_exit(1); } - if (!file_reopen(stdin, "/keyboard", 0)) { + if (!freopen("/keyboard", "r", stdin)) { printf("couldn't open /keyboard\n"); _syscall_exit(1); } |