diff options
| author | Anton Kling <anton@kling.gg> | 2024-02-21 00:14:29 +0100 | 
|---|---|---|
| committer | Anton Kling <anton@kling.gg> | 2024-02-21 00:14:29 +0100 | 
| commit | 8ff63b062d724826d8017504063df9b92f8e6703 (patch) | |
| tree | 03bf0b5a278a4908da8912f956e5651bea9412f1 /kernel/poll.c | |
| parent | a85eacdd2406fede4d6ff5cb130b1758978cabb3 (diff) | |
New clang-format options
Diffstat (limited to 'kernel/poll.c')
| -rw-r--r-- | kernel/poll.c | 18 | 
1 files changed, 12 insertions, 6 deletions
| diff --git a/kernel/poll.c b/kernel/poll.c index 0452bc8..963bfcc 100644 --- a/kernel/poll.c +++ b/kernel/poll.c @@ -15,8 +15,9 @@ int poll(struct pollfd *fds, size_t nfds, int timeout) {    struct list *write_list = &get_current_task()->write_list;    struct list *disconnect_list = &get_current_task()->disconnect_list;    for (size_t i = 0; i < nfds; i++) { -    if (fds[i].fd < 0) +    if (fds[i].fd < 0) {        continue; +    }      vfs_fd_t *f = get_vfs_fd(fds[i].fd);      if (NULL == f) {        continue; @@ -47,17 +48,22 @@ int poll(struct pollfd *fds, size_t nfds, int timeout) {      }      vfs_fd_t *f = get_vfs_fd(fds[i].fd);      if (!f) { -      if (fds[i].events & POLLHUP) +      if (fds[i].events & POLLHUP) {          fds[i].revents |= POLLHUP; +      }      } else { -      if (f->inode->has_data && fds[i].events & POLLIN) +      if (f->inode->has_data && fds[i].events & POLLIN) {          fds[i].revents |= POLLIN; -      if (f->inode->can_write && fds[i].events & POLLOUT) +      } +      if (f->inode->can_write && fds[i].events & POLLOUT) {          fds[i].revents |= POLLOUT; -      if (!(f->inode->is_open) && fds[i].events & POLLHUP) +      } +      if (!(f->inode->is_open) && fds[i].events & POLLHUP) {          fds[i].revents |= POLLHUP; -      if (fds[i].revents) +      } +      if (fds[i].revents) {          rc++; +      }      }    }    enable_interrupts(); |