if ((revents|EPOLLIN|EPOLLHUP) != (EPOLLIN|EPOLLHUP)) {
log_error("Got invalid event from epoll for stdout stream: %"PRIx32, revents);
- r = -EIO;
goto terminate;
}
return 0;
log_warning("Failed to read from stream: %m");
- r = -errno;
goto terminate;
}
if (l == 0) {
- r = stdout_stream_scan(s, true);
+ stdout_stream_scan(s, true);
goto terminate;
}
LIST_REMOVE(stdout_stream, s->server->stdout_streams, s);
}
- if (s->event_source)
+ if (s->event_source) {
+ sd_event_source_set_enabled(s->event_source, SD_EVENT_OFF);
s->event_source = sd_event_source_unref(s->event_source);
+ }
if (s->fd >= 0)
close_nointr_nofail(s->fd);
len = sizeof(stream->ucred);
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &stream->ucred, &len) < 0) {
log_error("Failed to determine peer credentials: %m");
- r = -errno;
goto fail;
}
if (shutdown(fd, SHUT_WR) < 0) {
log_error("Failed to shutdown writing side of socket: %m");
- r = -errno;
goto fail;
}
fail:
stdout_stream_free(stream);
- return r;
+ return 0;
}
int server_open_stdout_socket(Server *s) {