From 8ff63b062d724826d8017504063df9b92f8e6703 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Wed, 21 Feb 2024 00:14:29 +0100 Subject: New clang-format options --- kernel/syscalls/isatty.c | 6 ++++-- kernel/syscalls/recvfrom.c | 3 ++- kernel/syscalls/stat.c | 3 ++- kernel/syscalls/write.c | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'kernel/syscalls') diff --git a/kernel/syscalls/isatty.c b/kernel/syscalls/isatty.c index 883886e..9f3cca1 100644 --- a/kernel/syscalls/isatty.c +++ b/kernel/syscalls/isatty.c @@ -4,9 +4,11 @@ int syscall_isatty(int fd) { vfs_fd_t *fd_ptr = get_vfs_fd(fd); - if (!fd_ptr) + if (!fd_ptr) { return -EBADF; - if (!fd_ptr->is_tty) + } + if (!fd_ptr->is_tty) { return -ENOTTY; + } return 1; } diff --git a/kernel/syscalls/recvfrom.c b/kernel/syscalls/recvfrom.c index ecc9fdf..c35dcfa 100644 --- a/kernel/syscalls/recvfrom.c +++ b/kernel/syscalls/recvfrom.c @@ -24,8 +24,9 @@ size_t syscall_recvfrom( u16 data_length; socklen_t tmp_socklen; vfs_pread(socket, &tmp_socklen, sizeof(socklen_t), 0); - if (address_len) + if (address_len) { *address_len = tmp_socklen; + } if (address) { vfs_pread(socket, address, tmp_socklen, 0); } else { diff --git a/kernel/syscalls/stat.c b/kernel/syscalls/stat.c index 0af2121..83ad3f0 100644 --- a/kernel/syscalls/stat.c +++ b/kernel/syscalls/stat.c @@ -6,8 +6,9 @@ int syscall_stat(SYS_STAT_PARAMS *args) { const char *pathname = copy_and_allocate_user_string(args->pathname); struct stat *statbuf = args->statbuf; int fd = vfs_open(pathname, O_READ, 0); - if (0 > fd) + if (0 > fd) { return -ENOENT; + } int rc = vfs_fstat(fd, statbuf); vfs_close(fd); return rc; diff --git a/kernel/syscalls/write.c b/kernel/syscalls/write.c index ef8a46f..80c6e57 100644 --- a/kernel/syscalls/write.c +++ b/kernel/syscalls/write.c @@ -4,8 +4,9 @@ int syscall_write(int fd, const char *buf, size_t count) { vfs_fd_t *fd_ptr = get_vfs_fd(fd); - if (!fd_ptr) + if (!fd_ptr) { return -EBADF; + } int rc = vfs_pwrite(fd, (char *)buf, count, fd_ptr->offset); fd_ptr->offset += rc; return rc; -- cgit v1.2.3