diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2010-08-11 10:29:12 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-11 10:29:12 -0400 |
commit | 8e239cae8aae89f07a885ffcc985600ce9c65d5d (patch) | |
tree | ea25e2f9e7e37294b5f3fceae55790985715704b | |
parent | 2995607f86b7cfc918b3c140f481c5809fc3306c (diff) | |
download | fio-8e239cae8aae89f07a885ffcc985600ce9c65d5d.tar.gz |
Cleanup MSG_DONTWAIT
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r-- | engines/net.c | 18 | ||||
-rw-r--r-- | os/os-aix.h | 1 | ||||
-rw-r--r-- | os/os.h | 4 |
3 files changed, 9 insertions, 14 deletions
diff --git a/engines/net.c b/engines/net.c index 9e6e789e..0566a618 100644 --- a/engines/net.c +++ b/engines/net.c @@ -223,10 +223,7 @@ static int fio_netio_splice_out(struct thread_data *td, struct io_u *io_u) static int fio_netio_send(struct thread_data *td, struct io_u *io_u) { struct netio_data *nd = td->io_ops->data; - int ret, flags = 0; -#ifdef MSG_DONTWAIT - flags = MSG_DONTWAIT; -#endif + int ret, flags = OS_MSG_DONTWAIT; do { if (nd->net_protocol == IPPROTO_UDP) { @@ -254,9 +251,7 @@ static int fio_netio_send(struct thread_data *td, struct io_u *io_u) if (ret <= 0) break; -#ifdef MSG_DONTWAIT - flags &= ~MSG_DONTWAIT; -#endif + flags &= ~OS_MSG_DONTWAIT; } while (1); return ret; @@ -281,10 +276,7 @@ static int is_udp_close(struct io_u *io_u, int len) static int fio_netio_recv(struct thread_data *td, struct io_u *io_u) { struct netio_data *nd = td->io_ops->data; - int ret, flags = 0; -#ifdef MSG_DONTWAIT - flags = MSG_DONTWAIT; -#endif + int ret, flags = OS_MSG_DONTWAIT; do { if (nd->net_protocol == IPPROTO_UDP) { @@ -307,9 +299,7 @@ static int fio_netio_recv(struct thread_data *td, struct io_u *io_u) ret = poll_wait(td, io_u->file->fd, POLLIN); if (ret <= 0) break; -#ifdef MSG_DONTWAIT - flags &= ~MSG_DONTWAIT; -#endif + flags &= ~OS_MSG_DONTWAIT; flags |= MSG_WAITALL; } while (1); diff --git a/os/os-aix.h b/os/os-aix.h index 7a646978..96d90976 100644 --- a/os/os-aix.h +++ b/os/os-aix.h @@ -13,6 +13,7 @@ #define FIO_HAVE_PSHARED_MUTEX #define OS_MAP_ANON MAP_ANON +#define OS_MSG_DONTWAIT 0 static inline int blockdev_invalidate_cache(int fd) { @@ -37,6 +37,10 @@ #include "../lib/strsep.h" #endif +#ifdef MSG_DONTWAIT +#define OS_MSG_DONTWAIT MSG_DONTWAIT +#endif + #ifndef FIO_HAVE_FADVISE #define fadvise(fd, off, len, advice) (0) |