Change-Id: Ib8abd22294360784158a75d49af127019922872a
assert(lpd->log_len != UNLIMITED_LOG_LEN);
while (lpd->log_len > 0) {
int r = read(fdi->fd, buff, sizeof buff);
+ assert(r != 0);
if (r < 0) {
/* Logs arriving into the buffer can overwrite existing logs,
* but this doesn't update the total length on our side. This
assert(!lpd->monitor);
int r = read(fdi->fd, buff, sizeof buff);
+ assert(r != 0);
if (r < 0) {
if (lpd->log_len > 0 && lpd->log_len != UNLIMITED_LOG_LEN) {
// See above
return -1;
}
- if (read_cnt == NELEMS(READS))
- return 0;
+ if (read_cnt == NELEMS(READS)) {
+ errno = EAGAIN;
+ return -1;
+ }
const size_t current_read = READS[read_cnt++];
assert(current_read < count);