* lib/closein.c (close_stdin): Improve comments.
Signed-off-by: Eric Blake <eblake@redhat.com>
+2011-08-10 Eric Blake <eblake@redhat.com>
+
+ closein: correct comments
+ * lib/closein.c (close_stdin): Improve comments.
+
2011-08-09 Bruno Haible <bruno@clisp.org>
More tests for 'fseeko'.
2011-08-09 Bruno Haible <bruno@clisp.org>
More tests for 'fseeko'.
For example, POSIX requires that these two commands behave alike:
(sed -ne 1q; cat) < file
For example, POSIX requires that these two commands behave alike:
(sed -ne 1q; cat) < file
Since close_stdin is commonly registered via 'atexit', POSIX
and the C standard both say that it should not call 'exit',
Since close_stdin is commonly registered via 'atexit', POSIX
and the C standard both say that it should not call 'exit',
/* There is no need to flush stdin if we can determine quickly that stdin's
input buffer is empty; in this case we know that if stdin is seekable,
/* There is no need to flush stdin if we can determine quickly that stdin's
input buffer is empty; in this case we know that if stdin is seekable,
- fseeko (stdin, 0, SEEK_CUR) == lseek (0, 0, SEEK_CUR). */
+ (fseeko (stdin, 0, SEEK_CUR), ftello (stdin))
+ == lseek (0, 0, SEEK_CUR). */
if (freadahead (stdin) > 0)
{
/* Only attempt flush if stdin is seekable, as fflush is entitled to
if (freadahead (stdin) > 0)
{
/* Only attempt flush if stdin is seekable, as fflush is entitled to