X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fdiscard.c;h=e38e5b0bcd56cb90ca0290e55292eece4256e3ff;hb=7e421e1fd5cf1c4ce33edc005fa63784d9c5a2e6;hp=21fc88f9be34ebe702f9dac83cd1d13ac45d79a6;hpb=a485ed478abbd599d8c9aab48934e7a26733ecb1;p=mmh diff --git a/sbr/discard.c b/sbr/discard.c index 21fc88f..e38e5b0 100644 --- a/sbr/discard.c +++ b/sbr/discard.c @@ -1,22 +1,14 @@ /* - * discard.c -- discard output on a file pointer - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** discard.c -- discard output on a file pointer +** +** This code is Copyright (c) 2002, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ #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; @@ -63,4 +37,3 @@ discard (FILE *io) # endif #endif } -