aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-07-07 21:38:43 +0000
committerUlrich Drepper <drepper@redhat.com>2007-07-07 21:38:43 +0000
commite9055017f6d2015c4c74c94b1c2bf59968db223f (patch)
tree81fd5f6ba0e21c9d2d9465120e710248649191c1 /libio/wstrops.c
parent[BZ #4745] (diff)
downloadglibc-e9055017f6d2015c4c74c94b1c2bf59968db223f.tar.gz
glibc-e9055017f6d2015c4c74c94b1c2bf59968db223f.tar.bz2
glibc-e9055017f6d2015c4c74c94b1c2bf59968db223f.zip
* libio/wstrops.c (_IO_wstr_underflow): Clear errno before
returning WEOF. * stdio-common/Makefile (tests): Add bug18a. * stdio-common/bug18a.c: New file.
Diffstat (limited to 'libio/wstrops.c')
-rw-r--r--libio/wstrops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libio/wstrops.c b/libio/wstrops.c
index c5aae7bc6a..dfb312f6b7 100644
--- a/libio/wstrops.c
+++ b/libio/wstrops.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993,1997-1999,2001-2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1997-1999,2001-2004,2006,2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -154,7 +155,12 @@ _IO_wstr_underflow (fp)
if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end)
return *fp->_wide_data->_IO_read_ptr;
else
- return WEOF;
+ {
+ /* We have to reset errno since callers check for errno being
+ EINTR and there has been no such problem here. */
+ __set_errno (0);
+ return WEOF;
+ }
}