while (remain > 0)
{
written = write(fd, (char*) pData, remain);
+ if (written < 0)
+ {
+ _LOGE("Failed to send a request: %d, %s", errno, strerror(errno));
+
+ ReleaseFd(fd);
+ return MESSAGEPORT_ERROR_IO_ERROR;
+ }
+
remain -= written;
pData += written;
}
ReleaseFd(fd);
return MESSAGEPORT_ERROR_IO_ERROR;
}
+
remain -= written;
pData += written;
}
}
_LOGE("Failed to poll (%d, %s).", errno, strerror(errno));
+
+ ReleaseFd(fd);
return MESSAGEPORT_ERROR_IO_ERROR;
}
if (pReply == NULL)
{
_LOGE("The memory is insufficient.");
+
+ ReleaseFd(fd);
return MESSAGEPORT_ERROR_OUT_OF_MEMORY;
}