Fix error check from write in channel_write

This commit is contained in:
Szymon Janc 2011-05-10 11:06:51 +02:00 committed by Johan Hedberg
parent 31079f3b1b
commit 2c68908c11

View File

@ -212,7 +212,7 @@ static int channel_write(GIOChannel *chan, char *buf, size_t size)
while (wbytes < size) {
written = write(fd, buf + wbytes, size - wbytes);
if (written)
if (written < 0)
return -errno;
wbytes += written;