Attention is currently required from: pespin.
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39281?usp=email )
Change subject: bring twrtp into libosmo-netif ......................................................................
Patch Set 8:
(6 comments)
File src/twrtp.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/39281/comment/b6625a30_2a2001e6... : PS7, Line 304: close(rtcp_fd);
if (rtcp_fd >= 0) […]
Done
https://gerrit.osmocom.org/c/libosmo-netif/+/39281/comment/c5d8eece_357c21c4... : PS7, Line 313: close(rtcp_fd);
if (rtcp_fd >= 0) […]
Done
https://gerrit.osmocom.org/c/libosmo-netif/+/39281/comment/3f9e3284_c90264e4... : PS7, Line 322: close(rtcp_fd);
if (rtcp_fd >= 0) […]
Done
https://gerrit.osmocom.org/c/libosmo-netif/+/39281/comment/be05444d_e1e04ebc... : PS7, Line 333: close(rtcp_fd);
if (rtcp_fd >= 0) […]
Done
https://gerrit.osmocom.org/c/libosmo-netif/+/39281/comment/81a36416_e34f9d7f... : PS7, Line 343: close(rtcp_fd);
if (rtcp_fd >= 0) […]
Done
https://gerrit.osmocom.org/c/libosmo-netif/+/39281/comment/160f7029_f98c7c3d... : PS7, Line 348: return 0;
You could add return goto tags here for failing cases to make closing/freeing more organized and cle […]
I am not smart enough to find a way to do it cleanly. In some error exit paths we need to explicitly close the passed fd, yet in others the closing is done by `osmo_iofd_free()`. Doing an extra `close()` after `osmo_iofd_free()` could create a race condition in multi-threaded applications: what if some other thread opens a new file or socket etc and gets the same fd.
Can you accept Patchset 8 as it stands?