Cleanup MSG_DONTWAIT
authorJens Axboe <jaxboe@fusionio.com>
Wed, 11 Aug 2010 14:29:12 +0000 (10:29 -0400)
committerJens Axboe <jaxboe@fusionio.com>
Wed, 11 Aug 2010 14:29:12 +0000 (10:29 -0400)
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
engines/net.c
os/os-aix.h
os/os.h

index 9e6e789ece8f87ea2abf70409e1fbf447dce3285..0566a618254638f77bedc5d46c2ec80c3eb8ac73 100644 (file)
@@ -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;
 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) {
 
        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;
 
                if (ret <= 0)
                        break;
 
-#ifdef MSG_DONTWAIT
-               flags &= ~MSG_DONTWAIT;
-#endif
+               flags &= ~OS_MSG_DONTWAIT;
        } while (1);
 
        return ret;
        } 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;
 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) {
 
        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;
                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);
 
                flags |= MSG_WAITALL;
        } while (1);
 
index 7a6469781766b36a5d714b9f71a4d964d7f7bd63..96d909766de08c2a85d67e6cba1cc3fc21887a31 100644 (file)
@@ -13,6 +13,7 @@
 #define FIO_HAVE_PSHARED_MUTEX
 
 #define OS_MAP_ANON            MAP_ANON
 #define FIO_HAVE_PSHARED_MUTEX
 
 #define OS_MAP_ANON            MAP_ANON
+#define OS_MSG_DONTWAIT                0
 
 static inline int blockdev_invalidate_cache(int fd)
 {
 
 static inline int blockdev_invalidate_cache(int fd)
 {
diff --git a/os/os.h b/os/os.h
index e2bb0ba9a23b49da17be0fc6987d68b8b2f86d64..c8f517b6edc8c8199f1451afbdaf524bc1d926c2 100644 (file)
--- a/os/os.h
+++ b/os/os.h
 #include "../lib/strsep.h"
 #endif
 
 #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)
 
 #ifndef FIO_HAVE_FADVISE
 #define fadvise(fd, off, len, advice)  (0)