X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fdiscard.c;h=e38e5b0bcd56cb90ca0290e55292eece4256e3ff;hb=0dc22c053a80549b21709e3a518d843203b5f65d;hp=eb7e7c872d85af85f7e10eb5b8aac60a1b84d3fa;hpb=ced6090a330d3d83d0bce709f756aa3d7d65fea4;p=mmh diff --git a/sbr/discard.c b/sbr/discard.c index eb7e7c8..e38e5b0 100644 --- a/sbr/discard.c +++ b/sbr/discard.c @@ -8,15 +8,7 @@ #include -#ifdef HAVE_TERMIOS_H -# include -#else -# ifdef HAVE_TERMIO_H -# include -# else -# include -# endif -#endif +#include #ifdef SCO_5_STDIO # define _ptr __ptr @@ -27,33 +19,15 @@ void -discard (FILE *io) +discard(FILE *io) { -#ifndef HAVE_TERMIOS_H -# ifdef HAVE_TERMIO_H - struct termio tio; -# else - struct sgttyb tio; -# endif -#endif - if (io == NULL) return; -#ifdef HAVE_TERMIOS_H - tcflush (fileno(io), TCOFLUSH); -#else -# ifdef HAVE_TERMIO_H - if (ioctl (fileno(io), TCGETA, &tio) != -1) - ioctl (fileno(io), TCSETA, &tio); -# else - if (ioctl (fileno(io), TIOCGETP, (char *) &tio) != -1) - ioctl (fileno(io), TIOCSETP, (char *) &tio); -# endif -#endif + tcflush(fileno(io), TCOFLUSH); #if defined(_FSTDIO) || defined(__DragonFly__) - fpurge (io); + fpurge(io); #else # ifdef LINUX_STDIO io->_IO_write_ptr = io->_IO_write_base;