X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fnet.c;h=cf6025f1aa5ca6ecce389654be999ca135369476;hb=f65d1c2663ac6007eac1a2063fe25b4275d013e4;hp=3401039aa3480a0642ca86d50cf1002b94763ada;hpb=de890a1e48d40238dac69f302708dde8719de240;p=fio.git diff --git a/engines/net.c b/engines/net.c index 3401039a..cf6025f1 100644 --- a/engines/net.c +++ b/engines/net.c @@ -496,8 +496,9 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f) static int fio_netio_open_file(struct thread_data *td, struct fio_file *f) { int ret; + struct netio_options *o = td->eo; - if (td_read(td)) + if (o->listen) ret = fio_netio_accept(td, f); else ret = fio_netio_connect(td, f); @@ -701,13 +702,17 @@ static int fio_netio_init(struct thread_data *td) if (o->proto != FIO_TYPE_TCP) { if (o->listen) { - log_err("fio: listen only valid for TCP proto IO\n"); - return 1; + log_err("fio: listen only valid for TCP proto IO\n"); + return 1; } if (td_rw(td)) { - log_err("fio: datagram network connections must be" + log_err("fio: datagram network connections must be" " read OR write\n"); - return 1; + return 1; + } + if (o->proto == FIO_TYPE_UNIX && !td->o.filename) { + log_err("fio: UNIX sockets need host/filename\n"); + return 1; } o->listen = td_read(td); }