subscriber_list_t *sb = subscribe_head;
while (sb != NULL) {
subscriber_list_t *next = sb->next;
- // To check if a subscriber's stream is still open and writable call
- // write with an empty buffer and check the returned value. If the
- // stream is not writable anymore (i.e. it has been closed because the
- // process associated to this subscriber no longer exists) then write()
- // will return -1.
+ // Is the subscriber's stream closed?
if (write(fileno(sb->stream), NULL, 0) == -1) {
remove_subscriber(sb);
}