diff options
author | Max <msuraev@sysmocom.de> | 2022-12-18 21:03:13 +0300 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2023-02-10 11:43:26 +0000 |
commit | 50d4a66e347a42e08fa91351d7f5424e84729f45 (patch) | |
tree | 3ba65900e9a941e1a2aa6a474df5a4c3740a4e6d /include/osmocom | |
parent | 30b6d6134dea59ecd1eecd95d49921d6b061bde3 (diff) |
Add osmo_stream_srv_link_is_opened()
We use file descriptor of -1 as an indicator for unopened link internally.
However, since all the structs of libosmo-netif are opaque, using it from external
applications looks like a leaky abstraction.
Let's remedy this by adding function which properly check this for the library user.
Related: OS#5568
Change-Id: I91aa7da5f09ec4e8e2d21c827b45ed92e6b0e3d9
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/netif/stream.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index ce8f1d2..a52e7c4 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -36,7 +36,7 @@ void osmo_stream_srv_link_set_data(struct osmo_stream_srv_link *link, void *data void *osmo_stream_srv_link_get_data(struct osmo_stream_srv_link *link); char *osmo_stream_srv_link_get_sockname(const struct osmo_stream_srv_link *link); struct osmo_fd *osmo_stream_srv_link_get_ofd(struct osmo_stream_srv_link *link); - +bool osmo_stream_srv_link_is_opened(const struct osmo_stream_srv_link *link); int osmo_stream_srv_link_open(struct osmo_stream_srv_link *link); void osmo_stream_srv_link_close(struct osmo_stream_srv_link *link); |