about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--libio/fileops.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 43726ca8a5..9d9e215b07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-05-14  Ulrich Drepper  <drepper@gmail.com>
 
+	* libio/fileops.c (_IO_new_file_close_it): Initialize write_status.
+
 	[BZ #12432]
 	* sysdeps/ia64/backtrace.c (struct trace_reg): Add cfa element.
 	(dummy_getcfa): New function.
diff --git a/libio/fileops.c b/libio/fileops.c
index 678e32a641..343afa68b5 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -175,6 +175,8 @@ _IO_new_file_close_it (fp)
       else
 	write_status = _IO_SYSSEEK (fp, o, SEEK_SET) < 0 ? EOF : 0;
     }
+  else
+    write_status = 0;
 
   INTUSE(_IO_unsave_markers) (fp);