From 81a3176b689c546118be81565bcce16f47faae6b Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 14 Mar 2018 19:34:05 +0100 Subject: fixed make fot posix util/test --- code/test/Makefile | 2 +- code/test/vc_client_t.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'code/test') diff --git a/code/test/Makefile b/code/test/Makefile index ae400ee..9c804a3 100644 --- a/code/test/Makefile +++ b/code/test/Makefile @@ -1,4 +1,4 @@ -include ../ecp/Makefile.platform +include ../ecp/Makefile.posix CFLAGS=$(CFLAGS_PL) -I../ecp -I../util -Wno-int-to-void-pointer-cast LDFLAGS=$(LDFLAGS_PL) diff --git a/code/test/vc_client_t.c b/code/test/vc_client_t.c index 3a2402e..a530f2f 100644 --- a/code/test/vc_client_t.c +++ b/code/test/vc_client_t.c @@ -26,14 +26,12 @@ int counter = 0; uint64_t t_start = 0; uint64_t t_end = 0; ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s, ECP2Buffer *b) { - uint32_t seq = 0; - - ecp_conn_handle_open(conn, sq, t, p, s, b); - if (s < 0) { + ssize_t rv = ecp_conn_handle_open(conn, sq, t, p, s, b); + if (rv < 0) { printf("OPEN ERR:%ld\n", s); - return s; + return rv; } - + char *msg = "PERA JE CAR!"; unsigned char buf[1000]; @@ -44,12 +42,15 @@ ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned gettimeofday(&tv, NULL); t_start = tv.tv_sec*(uint64_t)1000000+tv.tv_usec; - return s; + return rv; } ssize_t handle_msg(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s, ECP2Buffer *b) { - counter++; + // write(2, p, s); + // fflush(stderr); // printf("MSG C:%s size:%ld\n", p, s); + // return s; + counter++; char *msg = "PERA JE CAR!"; unsigned char buf[1000]; -- cgit v1.2.3