diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-08-30 17:11:22 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-08-31 09:18:41 +0200 |
commit | 4060efec26115dbb9e68da67bc482a12b4f80ea8 (patch) | |
tree | 559ab25cc65cbac1ddda458f8370e8ee2675edf8 /src/tools/oping | |
parent | 8fe0340d2117cf9b5c724ff10621978ef2bee5f1 (diff) | |
download | ouroboros-4060efec26115dbb9e68da67bc482a12b4f80ea8.tar.gz ouroboros-4060efec26115dbb9e68da67bc482a12b4f80ea8.zip |
lib: Add fccntl configuration command
This replaces the flow_set_* commands with a single fccntl command
that can configure flows and the FRCT instance.
For more details, see "man 3 fccntl".
Diffstat (limited to 'src/tools/oping')
-rw-r--r-- | src/tools/oping/oping_client.c | 4 | ||||
-rw-r--r-- | src/tools/oping/oping_server.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index db0ef199..ca8c0e72 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -21,7 +21,7 @@ */ #include <ouroboros/dev.h> -#include <ouroboros/fcntl.h> +#include <ouroboros/fccntl.h> #include <ouroboros/time_utils.h> #include <signal.h> @@ -60,7 +60,7 @@ void * reader(void * o) double ms = 0; double d = 0; - flow_set_timeout(fd, &timeout); + fccntl(fd, FLOWSRCVTIMEO, &timeout); while (client.rcvd != client.count) { msg_len = flow_read(fd, buf, OPING_BUF_SIZE); diff --git a/src/tools/oping/oping_server.c b/src/tools/oping/oping_server.c index 6a535caf..0371f90f 100644 --- a/src/tools/oping/oping_server.c +++ b/src/tools/oping/oping_server.c @@ -130,7 +130,7 @@ void * accept_thread(void * o) server.times[fd] = now; pthread_mutex_unlock(&server.lock); - flow_set_flags(fd, FLOW_O_NONBLOCK | FLOW_O_RDWR); + fccntl(fd, FLOWSFLAGS, FLOWFNONBLOCK | FLOWFRDWR); } return (void *) 0; |