From 8e88e765ee17296a85c5ae372471ed248ce321db Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 19 Apr 2017 11:37:40 +0200 Subject: Mini reorganization --- src/lib/include/assert.h | 5 ----- src/lib/include/lua/lprefix.h | 1 + src/lib/libc/debug.c | 1 + src/lib/libc/stdio.c | 7 +++++-- 4 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 src/lib/include/assert.h create mode 120000 src/lib/include/lua/lprefix.h (limited to 'src/lib') diff --git a/src/lib/include/assert.h b/src/lib/include/assert.h deleted file mode 100644 index 655d6f6..0000000 --- a/src/lib/include/assert.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include - -/* vim: set sts=0 ts=4 sw=4 tw=0 noet :*/ diff --git a/src/lib/include/lua/lprefix.h b/src/lib/include/lua/lprefix.h new file mode 120000 index 0000000..3c5a9cb --- /dev/null +++ b/src/lib/include/lua/lprefix.h @@ -0,0 +1 @@ +../../lua/lprefix.h \ No newline at end of file diff --git a/src/lib/libc/debug.c b/src/lib/libc/debug.c index f862fe6..d88b204 100644 --- a/src/lib/libc/debug.c +++ b/src/lib/libc/debug.c @@ -4,6 +4,7 @@ #include #include #include +#include void sys_panic(const char* msg, const char* file, int line) { dbg_printf("PANIC in user process\n %s\n at %s:%d\n", msg, file, line); diff --git a/src/lib/libc/stdio.c b/src/lib/libc/stdio.c index dcbcf83..864fb34 100644 --- a/src/lib/libc/stdio.c +++ b/src/lib/libc/stdio.c @@ -322,15 +322,18 @@ int fflush(FILE* stream) { dbg_printf("FFLUSH %p\n", stream); if (!(stream->file_mode & FM_WRITE)) return 0; - if (stream == NULL || stream->fd == 0) return EOF; + if (stream == NULL || stream->fd == 0) { + return EOF; + } if (stream->buf_mode != 0 && stream->out_buf_used > 0) { size_t ret = sc_write(stream->fd, stream->pos, stream->out_buf_used, stream->out_buf); - stream->out_buf_used = 0; if (ret != stream->out_buf_used) { return EOF; } + + stream->out_buf_used = 0; if (!(stream->st.type & (FT_CHARDEV | FT_CHANNEL | FT_DIR))) { stream->pos += ret; } -- cgit v1.2.3