From 2c11fe3a7cab56152aa20d409e2b0105bd298ea5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 24 Aug 1999 23:06:11 +0000 Subject: [PATCH] (fopencookie): Set _fileno to -2. --- libio/iofopncook.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libio/iofopncook.c b/libio/iofopncook.c index 122966ecb4e..7b233b82b33 100644 --- a/libio/iofopncook.c +++ b/libio/iofopncook.c @@ -171,5 +171,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; } -- 2.47.3