assert(reader);
while (true) {
- /* Note, nominally we had been polling the source FD entity and not
- * `device_fd`, but that is the same FD (see the init and free ops).
- * This is temporary redundancy due to the migration to threads. */
int r = TEMP_FAILURE_RETRY(read(reader->device_fd, reader->read_buffer, sizeof reader->read_buffer - 1));
if (r == 0)
break;
if (!ret)
return NULL;
- /* The reader has its own server struct
- * that will be created later, in run(). */
+ /* The reader nominally belongs to the server,
+ * but is mostly handled by its own thread. */
reader_common_init(&ret->common, server);
ret->device_fd = -1;