diff options
author | Anton Kling <anton@kling.gg> | 2024-04-17 23:15:36 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-04-17 23:15:36 +0200 |
commit | e8deee43bc0a8a9bf7664485bb0ce3b886189dae (patch) | |
tree | d6e2c2da813d2ca549cf512604d6560579dac2f4 /userland | |
parent | b913a159103bedec035207fe4d84c9ad9c313517 (diff) |
VFS/LibC: Fix small bugs
Diffstat (limited to 'userland')
-rw-r--r-- | userland/libc/fcntl/open.c | 2 | ||||
-rw-r--r-- | userland/libc/stdio/putchar.c | 2 | ||||
-rw-r--r-- | userland/minibox/utilities/touch.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/userland/libc/fcntl/open.c b/userland/libc/fcntl/open.c index 37bb629..357d826 100644 --- a/userland/libc/fcntl/open.c +++ b/userland/libc/fcntl/open.c @@ -8,7 +8,7 @@ int open(const char *file, int flags, ...) { if (flags & O_CREAT) { va_list ap; va_start(ap, flags); - mode = va_arg(ap, mode_t); + mode = va_arg(ap, int); va_end(ap); } RC_ERRNO(syscall(SYS_OPEN, file, flags, mode, 0, 0)); diff --git a/userland/libc/stdio/putchar.c b/userland/libc/stdio/putchar.c index 3fcf7ca..7db6125 100644 --- a/userland/libc/stdio/putchar.c +++ b/userland/libc/stdio/putchar.c @@ -2,6 +2,6 @@ #include <unistd.h> int putchar(int c) { - printf("%c", (char)c); + write(1, (char *)&c, 1); return c; } diff --git a/userland/minibox/utilities/touch.c b/userland/minibox/utilities/touch.c index 949ad96..dd2f072 100644 --- a/userland/minibox/utilities/touch.c +++ b/userland/minibox/utilities/touch.c @@ -5,7 +5,7 @@ int touch_main(int argc, char **argv) { if (argc < 2) return 1; int fd; - COND_PERROR_EXP(open(argv[1], 0, O_CREAT), "open", return 1) + COND_PERROR_EXP(open(argv[1], O_CREAT, 0), "open", return 1) close(fd); return 0; } |