From 110215a9a76594e808903af957f3273e3bc11a87 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 8 Jul 1999 11:59:45 +0000 Subject: Update. 1999-07-08 Andreas Schwab * libio/iofopncook.c (fopencookie): Set _fileno to -2. * libio/libioP.h (_IO_file_is_open): Only check for -1, not all negative numbers. * libio/fileops.c (_IO_new_file_close_it): Set _fileno to -1, not EOF. * libio/oldfileops.c (_IO_old_file_close_it): Likewise. 1999-07-08 Andreas Schwab * stdio-common/vfprintf.c (buffered_vfprintf): Initialize _mode. 1999-07-08 Andreas Schwab * libio/fileno.c: Return -1 instead of EOF and set errno if the stream is not a real file stream. 1999-07-08 Andreas Schwab * manual/charset.texi: Fix typos. --- libio/iofopncook.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libio/iofopncook.c') diff --git a/libio/iofopncook.c b/libio/iofopncook.c index 85ea35c22e..7b76826031 100644 --- a/libio/iofopncook.c +++ b/libio/iofopncook.c @@ -167,5 +167,10 @@ fopencookie (cookie, mode, io_functions) _IO_mask_flags (&new_f->cfile.__file, read_write, _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); + /* We use a negative number different from -1 for _fileno to mark that + this special stream is not associated with a real file, but still has + to be treated as such. */ + new_f->cfile.__file._fileno = -2; + return &new_f->cfile.__file; } -- cgit v1.2.3