Currently, tevent_add_fd() will accept a negative fd (e.g. -1). It will then fail later when select() is called on that file descriptor. (Making it difficult to track down where the faulty tevent_add_fd() was called.
tevent_add_fd() should fail and return NULL if the file descriptor is negative
Bug was noted on libtevent 0.9.8 and 0.9.10.
Created attachment 6246 [details]
Patch to return NULL on negative file descriptor
Fixed in master with d6a41c2723cda59b3cd6ae9a1e77b62f25067663.