X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fdiscard.c;h=03eaa102111e470ae51bf4eceb96462d63d1feeb;hb=5f08476e3bc5c134ce57d924b01d1c1fcacd53db;hp=7c132ceb1ea77e398dd5b18a3bff4e0f2ab0e1aa;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/sbr/discard.c b/sbr/discard.c index 7c132ce..03eaa10 100644 --- a/sbr/discard.c +++ b/sbr/discard.c @@ -1,13 +1,10 @@ - /* - * discard.c -- discard output on a file pointer - * - * $Id$ - * - * 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 @@ -30,40 +27,39 @@ void -discard (FILE *io) +discard(FILE *io) { #ifndef HAVE_TERMIOS_H # ifdef HAVE_TERMIO_H - struct termio tio; + struct termio tio; # else - struct sgttyb tio; + struct sgttyb tio; # endif #endif - if (io == NULL) - return; + if (io == NULL) + return; #ifdef HAVE_TERMIOS_H - tcflush (fileno(io), TCOFLUSH); + tcflush(fileno(io), TCOFLUSH); #else # ifdef HAVE_TERMIO_H - if (ioctl (fileno(io), TCGETA, &tio) != -1) - ioctl (fileno(io), TCSETA, &tio); + 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); + if (ioctl(fileno(io), TIOCGETP, (char *) &tio) != -1) + ioctl(fileno(io), TIOCSETP, (char *) &tio); # endif #endif -#ifdef _FSTDIO - fpurge (io); +#if defined(_FSTDIO) || defined(__DragonFly__) + fpurge(io); #else # ifdef LINUX_STDIO - io->_IO_write_ptr = io->_IO_write_base; + io->_IO_write_ptr = io->_IO_write_base; # else - if ((io->_ptr = io->_base)) - io->_cnt = 0; + if ((io->_ptr = io->_base)) + io->_cnt = 0; # endif #endif } -