aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2023-06-09 15:03:56 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2023-06-12 16:05:22 +0200
commita97bfa750e1c7fd81dd13cfc8223727cca52dba9 (patch)
tree609b2464497214ec59b366a9289fc19aa82b6091
parenta5d5b33a91987415db40d436a012deb60948351c (diff)
stream: Use cli->state to check if cli is already closed
-rw-r--r--src/stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream.c b/src/stream.c
index 7c8e21e..6fb41f1 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -306,7 +306,7 @@ bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli)
* abstraction and close the socket */
void osmo_stream_cli_close(struct osmo_stream_cli *cli)
{
- if (cli->ofd.fd == -1)
+ if (cli->state == STREAM_CLI_STATE_CLOSED)
return;
osmo_fd_unregister(&cli->ofd);
close(cli->ofd.fd);