summaryrefslogtreecommitdiff
path: root/libio/fileops.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-07-28 23:34:19 +0000
committerJakub Jelinek <jakub@redhat.com>2008-07-28 23:34:19 +0000
commitc7045198ca8f4ff5b97205340d51127f8503c2bd (patch)
tree387ee7a78760f683df6035af28d665e3972aa30b /libio/fileops.c
parentc83494a925f4b4b716f9ba3abcb5e695d3e2a8a9 (diff)
Updated to fedora-glibc-20080728T2320cvs/fedora-glibc-2_8_90-10
Diffstat (limited to 'libio/fileops.c')
-rw-r--r--libio/fileops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libio/fileops.c b/libio/fileops.c
index 95cd2d64c9..cf47c915a7 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997-2005, 2006, 2007
+/* Copyright (C) 1993, 1995, 1997-2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
@@ -428,9 +428,11 @@ _IO_new_file_attach (fp, fd)
/* Get the current position of the file. */
/* We have to do that since that may be junk. */
fp->_offset = _IO_pos_BAD;
+ int save_errno = errno;
if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
== _IO_pos_BAD && errno != ESPIPE)
return NULL;
+ __set_errno (save_errno);
return fp;
}
INTDEF2(_IO_new_file_attach, _IO_file_attach)