mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
socket-proxyd: do not hardcode -1 in a check for fd validity
This commit is contained in:
@@ -234,15 +234,15 @@ static int traffic_cb(sd_event_source *s, int fd, uint32_t revents, void *userda
|
||||
goto quit;
|
||||
|
||||
/* EOF on both sides? */
|
||||
if (c->server_fd == -1 && c->client_fd == -1)
|
||||
if (c->server_fd < 0 && c->client_fd < 0)
|
||||
goto quit;
|
||||
|
||||
/* Server closed, and all data written to client? */
|
||||
if (c->server_fd == -1 && c->server_to_client_buffer_full <= 0)
|
||||
if (c->server_fd < 0 && c->server_to_client_buffer_full <= 0)
|
||||
goto quit;
|
||||
|
||||
/* Client closed, and all data written to server? */
|
||||
if (c->client_fd == -1 && c->client_to_server_buffer_full <= 0)
|
||||
if (c->client_fd < 0 && c->client_to_server_buffer_full <= 0)
|
||||
goto quit;
|
||||
|
||||
r = connection_enable_event_sources(c);
|
||||
|
||||
Reference in New Issue
Block a user