Attention is currently required from: daniel, jolly.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )
Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor ......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/36188/comment/3ad11fab_d679c68c PS1, Line 9: Let's return an error if both osmo_iofd_setup() and osmo_iofd_register() : are called with an invalid file descriptor like -1.
I see the check for osmo_iofd_register(), but not for osmo_iofd_setup() in this patch.
at osmo_iofd_setup() time it is legal to pass -1. Only at osmo_iofd_register() time we can perform a check. Either iofd->fd is already set from the prior osmo_iofd_setup() call (good) or we have been give a valid fd as argument (good). But if neither of those two were valid (>= 0) then we have to bail out here.