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
+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
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;