From 51d8f69fb152ae5a47151c2f132fd4263ec3d144 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 14 Mar 2020 17:52:06 +0100 Subject: lib: Return number of written bytes on flow_write This is more in line with the write() system call and prepares for partial writes. Partial writes are disabled by default (and not yet implemented). Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/tools/operf/operf_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools/operf/operf_client.c') diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c index 3b0ff2af..004a8965 100644 --- a/src/tools/operf/operf_client.c +++ b/src/tools/operf/operf_client.c @@ -141,7 +141,7 @@ void * writer(void * o) msg->id = client.sent; - if (flow_write(*fdp, buf, client.size) == -1) { + if (flow_write(*fdp, buf, client.size) < 0) { printf("Failed to send packet.\n"); flow_dealloc(*fdp); free(buf); @@ -204,7 +204,7 @@ int client_main(void) else printf("Doing a unidirectional test.\n"); - if (flow_write(fd, &client.conf, sizeof(client.conf))) { + if (flow_write(fd, &client.conf, sizeof(client.conf)) < 0) { printf("Failed to send configuration.\n"); flow_dealloc(fd); return -1; -- cgit v1.2.3