Skip to content

Commit

Permalink
[BZ #6771]
Browse files Browse the repository at this point in the history
	* libio/fileops.c (_IO_new_file_attach): Preserve errno around
	success call of _IO_SEEKOFF or calls which failed because the
	descriptor is for a pipe.
  • Loading branch information
Ulrich Drepper committed Jul 26, 2008
1 parent 31f3b15 commit c4a710b
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
2008-07-26 Ulrich Drepper <drepper@redhat.com>

[BZ #6771]
* libio/fileops.c (_IO_new_file_attach): Preserve errno around
success call of _IO_SEEKOFF or calls which failed because the
descriptor is for a pipe.

* sunrpc/key_call.c (getkeyserv_handle): Use FD_CLOEXEC instead of
magic number.

4 changes: 3 additions & 1 deletion libio/fileops.c
Original file line number Diff line number Diff line change
@@ -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;
errno = save_errno;
return fp;
}
INTDEF2(_IO_new_file_attach, _IO_file_attach)

0 comments on commit c4a710b

Please sign in to comment.