mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-19 13:40:59 +08:00
[BZ #394]
2005-09-23 Ulrich Drepper <drepper@redhat.com> [BZ #394] * libio/fmemopen.c (fmemopen_write): Return 0 instead of -1 if nothing can be written. * libio/iofopncook.c (_IO_cookie_write): If something went wrong, set error bit.
This commit is contained in:
parent
997470b3e1
commit
32053042d4
@ -1,3 +1,11 @@
|
||||
2005-09-23 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
[BZ #394]
|
||||
* libio/fmemopen.c (fmemopen_write): Return 0 instead of -1 if
|
||||
nothing can be written.
|
||||
* libio/iofopncook.c (_IO_cookie_write): If something went wrong,
|
||||
set error bit.
|
||||
|
||||
2005-09-22 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
[BZ #281]
|
||||
|
@ -127,7 +127,7 @@ fmemopen_write (void *cookie, const char *b, size_t s)
|
||||
if ((size_t) (c->pos + addnullc) == c->size)
|
||||
{
|
||||
__set_errno (ENOSPC);
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
s = c->size - c->pos - addnullc;
|
||||
}
|
||||
|
@ -64,9 +64,16 @@ _IO_cookie_write (fp, buf, size)
|
||||
struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
|
||||
|
||||
if (cfile->__io_functions.write == NULL)
|
||||
return -1;
|
||||
{
|
||||
fp->_flags |= _IO_ERR_SEEN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cfile->__io_functions.write (cfile->__cookie, buf, size);
|
||||
_IO_ssize_t n = cfile->__io_functions.write (cfile->__cookie, buf, size);
|
||||
if (n < size)
|
||||
fp->_flags |= _IO_ERR_SEEN;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static _IO_off64_t
|
||||
|
Loading…
x
Reference in New Issue
Block a user