int (*client_cmds[NUM_SENDER_CMDS])(struct sender_command_data*);
};
+/**
+ * check a file descriptor for writability
+ *
+ * \param fd the file desctiptor
+ *
+ * \return positive if fd is ready for writing, zero if it isn't, negative if
+ * an error occured.
+ */
-
-static inline int _write_ok(int fd)
+static inline int write_ok(int fd)
{
struct timeval tv = {0, 0};
fd_set wfds;
ret = select(fd + 1, NULL, &wfds, NULL, &tv);
if (ret < 0 && errno == EINTR)
goto again;
- if (ret < 0)
- ret = 0;
return ret;
}
-