1 /* Test of closein module.
2 Copyright (C) 2007 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 /* Written by Eric Blake. */
28 #include "binary-io.h"
32 /* With no arguments, do nothing. With arguments, attempt to consume
33 first 6 bytes of stdin. In either case, let exit() take care of
34 closing std streams and changing exit status if ferror(stdin). */
36 main (int argc, char **argv)
41 program_name = argv[0];
43 /* close_stdin currently relies on ftell, but mingw ftell is
44 unreliable on text mode input. */
51 i = fread (buf, 1, 6, stdin);