From 563ec40ca81867c0d1cea1ae0f2381bfe832af24 Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Wed, 13 Aug 2003 10:49:24 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'V9_2_0_29mdk'. --- mdk-stage1/dietlibc/libstdio/fflush.c | 64 ----------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 mdk-stage1/dietlibc/libstdio/fflush.c (limited to 'mdk-stage1/dietlibc/libstdio/fflush.c') diff --git a/mdk-stage1/dietlibc/libstdio/fflush.c b/mdk-stage1/dietlibc/libstdio/fflush.c deleted file mode 100644 index e0e23b3ba..000000000 --- a/mdk-stage1/dietlibc/libstdio/fflush.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include -#include "dietwarning.h" -#include "dietstdio.h" - -FILE *__stdio_root; - -int __stdio_atexit=0; - -void __stdio_flushall(void) { - fflush(0); -} - -int fflush(FILE *stream) { - if (stream==0) { - int res; - FILE *f; - __fflush_stdin(); - __fflush_stdout(); - __fflush_stderr(); - for (res=0, f=__stdio_root; f; f=f->next) - if (fflush(f)) - res=-1; - return res; - } -// if (stream->flags&NOBUF) return 0; - if (stream->flags&BUFINPUT) { - register int tmp; - if ((tmp=stream->bm-stream->bs)) { - lseek(stream->fd,tmp,SEEK_CUR); - } - stream->bs=stream->bm=0; - } else { - if (stream->bm && write(stream->fd,stream->buf,stream->bm)!=(int)stream->bm) { - stream->flags|=ERRORINDICATOR; - return -1; - } - stream->bm=0; - } - return 0; -} - -int __fflush4(FILE *stream,int next) { - if (!__stdio_atexit) { - __stdio_atexit=1; - atexit(__stdio_flushall); - } - if ((stream->flags&BUFINPUT)!=next) { - int res=fflush(stream); - stream->flags=(stream->flags&~BUFINPUT)|next; - return res; - } - if (stream->fd==0) __fflush_stdout(); - return 0; -} - -/* Internal function, has no prototype. - * This is defined here because of the weak symbol ELF semantics */ -int __stdio_outs(const char *s,size_t len); -int __stdio_outs(const char *s,size_t len) { - return fwrite(s,1,(size_t)len,stdout)==len?1:0; -} - -link_warning("fflush","warning: your code uses stdio (7+k bloat).") -- cgit v1.2.1