Change-Id: I44e5c53401abc03605fdc9a0c15e5611742d31a1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
int r = write(reader->file.path ? reader->file.fd : reader->fd_entity.fd, dlogutil_entry, dlogutil_entry->len);
if (r < 0) {
- if (errno == EPIPE)
+ if (errno != EAGAIN)
return 1;
- return -1;
+
+ /* The pipe is just clogged, this is not an actual error.
+ * We own the entry so it needs to be saved for later. */
+ r = 0;
}
reader->file.size += r;
if (reader->partial_log_size) {
r = write(reader->fd_entity.fd, reader->partial_log, reader->partial_log_size);
if (r <= 0)
- return ret;
+ return r != 0 && errno != EAGAIN;
if (r < reader->partial_log_size) {
reader->partial_log_size -= r;