remove flush hook cruft that was never used from stdio
authorRich Felker <dalias@aerifal.cx>
Tue, 19 Jun 2012 04:05:35 +0000 (00:05 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 19 Jun 2012 04:05:35 +0000 (00:05 -0400)
there is no need/use for a flush hook. the write function serves this
purpose already. i originally created the hook for implementing mem
streams based on a mistaken reading of posix, and later realized it
wasn't useful but never removed it until now.

src/internal/stdio_impl.h
src/stdio/fflush.c
src/stdio/freopen.c

index a1f31b3..d54c918 100644 (file)
@@ -57,7 +57,7 @@ struct __FILE_s {
        int waiters;
        void *cookie;
        off_t off;
        int waiters;
        void *cookie;
        off_t off;
-       int (*flush)(FILE *);
+       void *dummy4;
        void *mustbezero_2;
        unsigned char *shend;
        off_t shlim, shcnt;
        void *mustbezero_2;
        unsigned char *shend;
        off_t shlim, shcnt;
index 4c1647b..715c1d1 100644 (file)
@@ -15,9 +15,6 @@ static int __fflush_unlocked(FILE *f)
        f->wpos = f->wbase = f->wend = 0;
        f->rpos = f->rend = 0;
 
        f->wpos = f->wbase = f->wend = 0;
        f->rpos = f->rend = 0;
 
-       /* Hook for special behavior on flush */
-       if (f->flush) f->flush(f);
-
        return 0;
 }
 
        return 0;
 }
 
index 958dbd2..b1f8fe7 100644 (file)
@@ -32,7 +32,6 @@ FILE *freopen(const char *filename, const char *mode, FILE *f)
        f->write = f2->write;
        f->seek = f2->seek;
        f->close = f2->close;
        f->write = f2->write;
        f->seek = f2->seek;
        f->close = f2->close;
-       f->flush = f2->flush;
 
        fclose(f2);
        return f;
 
        fclose(f2);
        return f;