Commit ff9a8750 by Thomas Koenig

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
parent cedc228d
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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment