The man pages state that the read, write, and except can all be NULL if timeout is not NULL.
Change the behavior of f_file_select() to allow this.
f_status_t f_file_select(const int highest_plus_one, fd_set * const read, fd_set * const write, fd_set * const except, struct timeval * const timeout) {
if (!highest_plus_one) return F_data_not;
- if (!read && !write && !except) return F_data_not;
+ if (!read && !write && !except && !timeout) return F_data_not;
if (select(highest_plus_one, read, write, except, timeout) == -1) {
if (errno == EBADF) return F_status_set_error(F_file_descriptor);
*
* @return
* F_none on success.
- * F_data_not if all three read, write, and except are NULL (having at least one is required) or when highest_plus_one is 0.
+ * F_data_not if all of read, write, except, and timeout are NULL (having at least one is required) or when highest_plus_one is 0.
*
* F_file_descriptor (with error bit) if the file descriptor is invalid.
* F_interrupt (with error bit) when program received an interrupt signal, halting operation.
}
{
- const f_status_t status = f_file_select(1, 0, 0, 0, &timeout);
+ const f_status_t status = f_file_select(0, 0, 0, 0, &timeout);
assert_int_equal(status, F_data_not);
}