summaryrefslogtreecommitdiff
path: root/src/tools/echo/echo_client.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-03-31 09:58:23 +0000
committerSander Vrijders <sander.vrijders@ugent.be>2017-03-31 09:58:23 +0000
commitad01a7fd0b6cd798b2d5a2901ae8499b25360707 (patch)
tree16b6fd66c3fe93d178e10a137179923b513851f9 /src/tools/echo/echo_client.c
parent5f79a21b80e68ba59616f0fa431287c3e94c43cf (diff)
parent7ba0fd0ce19244745c8d2512ce8a003783d914a7 (diff)
downloadouroboros-ad01a7fd0b6cd798b2d5a2901ae8499b25360707.tar.gz
ouroboros-ad01a7fd0b6cd798b2d5a2901ae8499b25360707.zip
Merged in dstaesse/ouroboros/be-new-api (pull request #439)
lib: Revise flow allocation API
Diffstat (limited to 'src/tools/echo/echo_client.c')
-rw-r--r--src/tools/echo/echo_client.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/tools/echo/echo_client.c b/src/tools/echo/echo_client.c
index f84de73a..5ec2051f 100644
--- a/src/tools/echo/echo_client.c
+++ b/src/tools/echo/echo_client.c
@@ -26,25 +26,17 @@
int client_main(void)
{
int fd = 0;
- int result = 0;
char buf[BUF_SIZE];
char * message = "Client says hi!";
ssize_t count = 0;
- fd = flow_alloc("echo", NULL);
+ fd = flow_alloc("echo", NULL, NULL);
if (fd < 0) {
printf("Failed to allocate flow.\n");
return -1;
}
- result = flow_alloc_res(fd);
- if (result < 0) {
- printf("Flow allocation refused.\n");
- flow_dealloc(fd);
- return -1;
- }
-
- if (flow_write(fd, message, strlen(message) + 1) == -1) {
+ if (flow_write(fd, message, strlen(message) + 1) < 0) {
printf("Failed to write SDU.\n");
flow_dealloc(fd);
return -1;