unix.c (buf_write): Return early if there is nothing to write.

2017-07-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* io/unix.c (buf_write):  Return early if there is
	nothing to write.

From-SVN: r250473
This commit is contained in:
Thomas Koenig 2017-07-24 10:42:23 +00:00
parent cedc228d1c
commit ff9a87509d
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2017-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
* io/unix.c (buf_write): Return early if there is
nothing to write.
2017-06-09 Thomas Koenig <tkoenig@gcc.gnu.org>
* intrinsics/eoshift2.c (eoshift2): Use memcpy

View File

@ -582,6 +582,9 @@ buf_read (unix_stream *s, void *buf, ssize_t nbyte)
static ssize_t
buf_write (unix_stream *s, const void *buf, ssize_t nbyte)
{
if (nbyte == 0)
return 0;
if (s->ndirty == 0)
s->buffer_offset = s->logical_offset;