From b5cd18739a64c8d923a55b61c89ae3900faafd84 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 9 Dec 2025 21:17:12 +0100 Subject: Fix include paths and formatting inconsistencies --- lib/libc/stdio/fseek.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'lib/libc/stdio/fseek.c') diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c index af12cd2c..0e425e8e 100644 --- a/lib/libc/stdio/fseek.c +++ b/lib/libc/stdio/fseek.c @@ -1,28 +1,31 @@ -#include -#include -#include -#include +#include "__stdio.h" // for _IO_EOF, _IO_ERR +#include "stddef.h" // for NULL + +#include // for LIBC_LOCK, LIBC_UNLOCK +#include // for __IMPL +#include // for FILE, fseek +#include // for lseek, off_t int fseek(FILE *stream, long offset, int whence) { - if (stream == NULL || stream->fd < 0) + if (stream == NULL || __IMPL(stream)->fd < 0) return -1; - LIBC_LOCK(stream->lock); + LIBC_LOCK(__IMPL(stream)->lock); - stream->buf_pos = 0; - stream->buf_len = 0; - stream->flags &= ~_IO_EOF; + __IMPL(stream)->buf_pos = 0; + __IMPL(stream)->buf_len = 0; + __IMPL(stream)->flags &= ~_IO_EOF; - off_t result = lseek(stream->fd, offset, whence); + off_t result = lseek(__IMPL(stream)->fd, offset, whence); - LIBC_UNLOCK(stream->lock); + LIBC_UNLOCK(__IMPL(stream)->lock); if (result == (off_t)-1) { - stream->flags |= _IO_ERR; + __IMPL(stream)->flags |= _IO_ERR; return -1; } - stream->offset = result; + __IMPL(stream)->offset = result; return 0; } -- cgit v1.2.3