int x[20];
errno = 0;
- if ((r = read(l->write_fds[0], x, sizeof(x))) <= 0 && errno != EINTR)
+ if ((r = read(l->write_fds[0], x, sizeof(x))) < 0 && errno != EINTR)
return -1;
+
+ pa_assert(r != 0);
if (r > 0)
if (pa_atomic_sub(&l->n_read, r) <= r)
return -1;
}
+ pa_assert(r != 0);
+
if (r > 0)
pa_atomic_sub(&l->n_read, r);
}
int x[20];
errno = 0;
- if ((r = read(l->read_fds[0], x, sizeof(x))) <= 0 && errno != EINTR)
+ if ((r = read(l->read_fds[0], x, sizeof(x))) < 0 && errno != EINTR)
return NULL;
+
+ pa_assert(r != 0);
if (r > 0)
if (pa_atomic_sub(&l->n_written, r) <= r)
_Y;
- if ((r = read(l->read_fds[0], x, sizeof(x)) < 0) && errno != EINTR) {
+ if ((r = read(l->read_fds[0], x, sizeof(x))) < 0 && errno != EINTR) {
pa_atomic_dec(&l->read_waiting);
return NULL;
}
+ pa_assert(r != 0);
+
if (r > 0)
pa_atomic_sub(&l->n_written, r);
}
pa_assert(pa_atomic_load(&l->read_waiting) > 0);
pa_atomic_dec(&l->read_waiting);
-
-
-
}