summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2010-08-11 10:29:12 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-11 10:29:12 -0400
commit8e239cae8aae89f07a885ffcc985600ce9c65d5d (patch)
treeea25e2f9e7e37294b5f3fceae55790985715704b
parent2995607f86b7cfc918b3c140f481c5809fc3306c (diff)
downloadfio-8e239cae8aae89f07a885ffcc985600ce9c65d5d.tar.gz
Cleanup MSG_DONTWAIT
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--engines/net.c18
-rw-r--r--os/os-aix.h1
-rw-r--r--os/os.h4
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)
{
diff --git a/os/os.h b/os/os.h
index e2bb0ba9..c8f517b6 100644
--- a/os/os.h
+++ b/os/os.h
@@ -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)