projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove duplicate code in parser
[fio.git]
/
engines
/
net.c
diff --git
a/engines/net.c
b/engines/net.c
index c0a793e86cb8d7f38dfff1601ae218b2eb6d387a..6866ba2d840465a0dfbeb85372016704c22c5ace 100644
(file)
--- a/
engines/net.c
+++ b/
engines/net.c
@@
-223,7
+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 = MSG_DONTWAIT;
+ int ret, flags =
OS_
MSG_DONTWAIT;
do {
if (nd->net_protocol == IPPROTO_UDP) {
do {
if (nd->net_protocol == IPPROTO_UDP) {
@@
-251,7
+251,7
@@
static int fio_netio_send(struct thread_data *td, struct io_u *io_u)
if (ret <= 0)
break;
if (ret <= 0)
break;
- flags &= ~MSG_DONTWAIT;
+ flags &= ~
OS_
MSG_DONTWAIT;
} while (1);
return ret;
} while (1);
return ret;
@@
-276,11
+276,15
@@
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 = MSG_DONTWAIT;
+ int ret, flags =
OS_
MSG_DONTWAIT;
do {
if (nd->net_protocol == IPPROTO_UDP) {
do {
if (nd->net_protocol == IPPROTO_UDP) {
+#ifdef __hpux
+ int len = sizeof(nd->addr);
+#else
socklen_t len = sizeof(nd->addr);
socklen_t len = sizeof(nd->addr);
+#endif
struct sockaddr *from = (struct sockaddr *) &nd->addr;
ret = recvfrom(io_u->file->fd, io_u->xfer_buf,
struct sockaddr *from = (struct sockaddr *) &nd->addr;
ret = recvfrom(io_u->file->fd, io_u->xfer_buf,
@@
-299,7
+303,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;
- flags &= ~MSG_DONTWAIT;
+ flags &= ~
OS_
MSG_DONTWAIT;
flags |= MSG_WAITALL;
} while (1);
flags |= MSG_WAITALL;
} while (1);
@@
-377,7
+381,11
@@
static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
{
struct netio_data *nd = td->io_ops->data;
static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
{
struct netio_data *nd = td->io_ops->data;
+#ifdef __hpux
+ int socklen = sizeof(nd->addr);
+#else
socklen_t socklen = sizeof(nd->addr);
socklen_t socklen = sizeof(nd->addr);
+#endif
if (nd->net_protocol == IPPROTO_UDP) {
f->fd = nd->listenfd;
if (nd->net_protocol == IPPROTO_UDP) {
f->fd = nd->listenfd;
@@
-633,7
+641,7
@@
static struct ioengine_ops ioengine_splice = {
.open_file = fio_netio_open_file,
.close_file = generic_close_file,
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
.open_file = fio_netio_open_file,
.close_file = generic_close_file,
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
- FIO_SIG
QUIT
| FIO_PIPEIO,
+ FIO_SIG
TERM
| FIO_PIPEIO,
};
#endif
};
#endif
@@
-648,7
+656,7
@@
static struct ioengine_ops ioengine_rw = {
.open_file = fio_netio_open_file,
.close_file = fio_netio_close_file,
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
.open_file = fio_netio_open_file,
.close_file = fio_netio_close_file,
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR |
- FIO_SIG
QUIT
| FIO_PIPEIO,
+ FIO_SIG
TERM
| FIO_PIPEIO,
};
static void fio_init fio_netio_register(void)
};
static void fio_init fio_netio_register(void)