- if ((r = read(f->efd, &u, sizeof(u))) != sizeof(u)) {
- pa_assert(r < 0 && errno == EINTR);
+ if ((r = pa_read(f->efd, &u, sizeof(u), NULL)) != sizeof(u)) {
+
+ if (r >= 0 || errno != EINTR) {
+ pa_log_error("Invalid read from eventfd: %s", r < 0 ? pa_cstrerror(errno) : "EOF");
+ pa_assert_not_reached();
+ }
+