evas/cserve2: write() can return other errors.

In case of error, return from the function and don't decrement
the send variable.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
This commit is contained in:
Jean-Philippe Andre 2013-06-26 11:50:07 +09:00 committed by Cedric Bail
parent f7c6545170
commit 6a2a0187ff
1 changed files with 7 additions and 2 deletions

View File

@ -153,10 +153,15 @@ _slave_write(Slave *s, const char *data, size_t size)
{ {
if (errno == EAGAIN) if (errno == EAGAIN)
break; break;
if (errno == EPIPE) else if (errno == EPIPE)
{ {
WRN("Slave unexpectedly gone."); WRN("Slave unexpectedly gone.");
/* handle dead? */ /* FIXME: handle dead? */
break;
}
else
{
ERR("Unhandled error occurred when writing to slave: %d %m", errno);
break; break;
} }
} }