diff options
author | Mystery Man <unknown@mandriva.org> | 2002-07-09 13:18:50 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2002-07-09 13:18:50 +0000 |
commit | 061aa98f8ab5e8b097f3c67e8074f3b057d1d1bf (patch) | |
tree | 6a497ebd94857616d1351e47418c0c3d6db4f563 /mdk-stage1/dietlibc/libstdio/fflush.c | |
parent | a6a904a31e39b74144c53f0cc4086d496b70c09a (diff) | |
download | drakx-061aa98f8ab5e8b097f3c67e8074f3b057d1d1bf.tar drakx-061aa98f8ab5e8b097f3c67e8074f3b057d1d1bf.tar.gz drakx-061aa98f8ab5e8b097f3c67e8074f3b057d1d1bf.tar.bz2 drakx-061aa98f8ab5e8b097f3c67e8074f3b057d1d1bf.tar.xz drakx-061aa98f8ab5e8b097f3c67e8074f3b057d1d1bf.zip |
This commit was manufactured by cvs2svn to create tag 'V1_1_8_3mdk'.V1_1_8_3mdk
Diffstat (limited to 'mdk-stage1/dietlibc/libstdio/fflush.c')
-rw-r--r-- | mdk-stage1/dietlibc/libstdio/fflush.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/mdk-stage1/dietlibc/libstdio/fflush.c b/mdk-stage1/dietlibc/libstdio/fflush.c deleted file mode 100644 index 7078e04f4..000000000 --- a/mdk-stage1/dietlibc/libstdio/fflush.c +++ /dev/null @@ -1,62 +0,0 @@ -#include "dietstdio.h" -#include <unistd.h> -#include <stdlib.h> -#include "dietwarning.h" - -FILE *__stdio_root; - -#ifdef WANT_BUFFERED_STDIO -int __stdio_atexit=0; - -void __stdio_flushall() { - fflush(0); -} - -extern int __fflush_stdin(); -extern int __fflush_stdout(); -extern int __fflush_stderr(); - -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&BUFINPUT) { - register int tmp; - if ((tmp=stream->bm-stream->bs)) lseek(stream->fd,tmp,SEEK_CUR); - } else - if (stream->bm && write(stream->fd,stream->buf,stream->bm)!=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; - } - return 0; -} - -#else -int fflush(FILE *stream) { - return 0; -} -#endif - -link_warning("fflush","warning: your code uses stdio (several kilobytes of bloat).") |