X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=send.h;h=3aebb1600ebfdee0450c0100ae8c99921c7c0cd0;hp=75c13731bb1af9223a0a32fdc8c85792f04f3d50;hb=08bd4a0d28f709a3b0ca5598e2a3eb62d4378800;hpb=1f556ae88bd8c85d4452f689f532f5a6abeabe92 diff --git a/send.h b/send.h index 75c13731..3aebb160 100644 --- a/send.h +++ b/send.h @@ -85,9 +85,16 @@ struct sender { 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; @@ -98,8 +105,5 @@ again: ret = select(fd + 1, NULL, &wfds, NULL, &tv); if (ret < 0 && errno == EINTR) goto again; - if (ret < 0) - ret = 0; return ret; } -