neels has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-upf/+/28985
)
Change subject: add comment about fd cleanup
......................................................................
add comment about fd cleanup
Clarify that calling osmo_fd_close() is fine if no fd is open.
Related: SYS#5599
Change-Id: Ibd471485fde90a14fe19f558b38a49b0b7d62909
---
M src/osmo-upf/upf_gtp.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/85/28985/1
diff --git a/src/osmo-upf/upf_gtp.c b/src/osmo-upf/upf_gtp.c
index 4a430cb..6280e45 100644
--- a/src/osmo-upf/upf_gtp.c
+++ b/src/osmo-upf/upf_gtp.c
@@ -449,6 +449,7 @@
while ((t = llist_first_entry_or_null(&dev->tunnels, struct upf_gtp_tun,
entry)))
talloc_free(t);
llist_del(&dev->entry);
+ /* osmo_fd_close() is a noop if ofd.fd == -1 */
osmo_fd_close(&dev->gtpv0.ofd);
osmo_fd_close(&dev->gtpv1.ofd);
if (dev->created)
--
To view, visit
https://gerrit.osmocom.org/c/osmo-upf/+/28985
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: Ibd471485fde90a14fe19f558b38a49b0b7d62909
Gerrit-Change-Number: 28985
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange