diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 23:14:53 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 23:14:53 +0100 |
| commit | 169daa11155988a210fac949297381743f3cb400 (patch) | |
| tree | 602ef5df5ae9ea075ab3d5dac3c8ad60da1ea2cc /lib/libc/stdio/fseek.c | |
| parent | 4e2112e165fdd94dee58378e3ea32892f3710cd7 (diff) | |
feat: clang-tidy fixes
Diffstat (limited to 'lib/libc/stdio/fseek.c')
| -rw-r--r-- | lib/libc/stdio/fseek.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c index 0e425e8e..7a6754f7 100644 --- a/lib/libc/stdio/fseek.c +++ b/lib/libc/stdio/fseek.c @@ -1,31 +1,30 @@ -#include "__stdio.h" // for _IO_EOF, _IO_ERR +#include "__stdio.h" // for __FILE, _IO_EOF, _IO_ERR #include "stddef.h" // for NULL #include <atomic.h> // for LIBC_LOCK, LIBC_UNLOCK -#include <libc.h> // for __IMPL #include <stdio.h> // for FILE, fseek #include <unistd.h> // for lseek, off_t int fseek(FILE *stream, long offset, int whence) { - if (stream == NULL || __IMPL(stream)->fd < 0) + if (stream == NULL || __FILE(stream)->fd < 0) return -1; - LIBC_LOCK(__IMPL(stream)->lock); + LIBC_LOCK(__FILE(stream)->lock); - __IMPL(stream)->buf_pos = 0; - __IMPL(stream)->buf_len = 0; - __IMPL(stream)->flags &= ~_IO_EOF; + __FILE(stream)->buf_pos = 0; + __FILE(stream)->buf_len = 0; + __FILE(stream)->flags &= ~_IO_EOF; - off_t result = lseek(__IMPL(stream)->fd, offset, whence); + off_t result = lseek(__FILE(stream)->fd, offset, whence); - LIBC_UNLOCK(__IMPL(stream)->lock); + LIBC_UNLOCK(__FILE(stream)->lock); if (result == (off_t)-1) { - __IMPL(stream)->flags |= _IO_ERR; + __FILE(stream)->flags |= _IO_ERR; return -1; } - __IMPL(stream)->offset = result; + __FILE(stream)->offset = result; return 0; } |
