diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-04-10 19:21:13 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2008-04-10 19:21:13 +0000 |
commit | b0c50524f1fb93adbd52e9950f92650e020b0d59 (patch) | |
tree | fd9af5238c7ebb9bb27ffafb3e47be9ed5ca2680 /libio/iofwrite_u.c | |
parent | 3a2e541ba348de2bbab7b65328694403e61e5dff (diff) |
Updated to fedora-glibc-20080410T1907
Diffstat (limited to 'libio/iofwrite_u.c')
-rw-r--r-- | libio/iofwrite_u.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libio/iofwrite_u.c b/libio/iofwrite_u.c index 738cc5b28f..d27c02ac31 100644 --- a/libio/iofwrite_u.c +++ b/libio/iofwrite_u.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1996-2000, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1996-2000, 2002, 2008 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 @@ -45,7 +45,11 @@ fwrite_unlocked (buf, size, count, fp) if (_IO_fwide (fp, -1) == -1) { written = _IO_sputn (fp, (const char *) buf, request); - if (written == request) + /* We have written all of the input in case the return value indicates + this or EOF is returned. The latter is a special case where we + simply did not manage to flush the buffer. But the data is in the + buffer and therefore written as far as fwrite is concerned. */ + if (written == request || written == EOF) return count; } |