X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-jsonrpc.c;h=d02a65f15238eabda721d2330dd026c1c18ebff6;hb=79c9f2ee7883b52860c76c3730725f5731402874;hp=570ae11a839fa451996c98d64bd580001a525b70;hpb=40f0707cd9d105203c2b8b97a955b57aca426f13;p=openvswitch diff --git a/tests/test-jsonrpc.c b/tests/test-jsonrpc.c index 570ae11a..d02a65f1 100644 --- a/tests/test-jsonrpc.c +++ b/tests/test-jsonrpc.c @@ -175,7 +175,7 @@ handle_rpc(struct jsonrpc *rpc, struct jsonrpc_msg *msg, bool *done) } static void -do_listen(int argc UNUSED, char *argv[]) +do_listen(int argc OVS_UNUSED, char *argv[]) { struct pstream *pstream; struct jsonrpc **rpcs; @@ -185,7 +185,7 @@ do_listen(int argc UNUSED, char *argv[]) die_if_already_running(); - error = pstream_open(argv[1], &pstream); + error = jsonrpc_pstream_open(argv[1], &pstream); if (error) { ovs_fatal(error, "could not listen on \"%s\"", argv[1]); } @@ -251,11 +251,12 @@ do_listen(int argc UNUSED, char *argv[]) } poll_block(); } + free(rpcs); + pstream_close(pstream); } - static void -do_request(int argc UNUSED, char *argv[]) +do_request(int argc OVS_UNUSED, char *argv[]) { struct jsonrpc_msg *msg; struct jsonrpc *rpc; @@ -273,7 +274,7 @@ do_request(int argc UNUSED, char *argv[]) ovs_fatal(0, "not a valid JSON-RPC request: %s", string); } - error = stream_open_block(argv[1], &stream); + error = stream_open_block(jsonrpc_stream_open(argv[1], &stream), &stream); if (error) { ovs_fatal(error, "could not open \"%s\"", argv[1]); } @@ -294,7 +295,7 @@ do_request(int argc UNUSED, char *argv[]) } static void -do_notify(int argc UNUSED, char *argv[]) +do_notify(int argc OVS_UNUSED, char *argv[]) { struct jsonrpc_msg *msg; struct jsonrpc *rpc; @@ -312,7 +313,7 @@ do_notify(int argc UNUSED, char *argv[]) ovs_fatal(0, "not a JSON RPC-valid notification: %s", string); } - error = stream_open_block(argv[1], &stream); + error = stream_open_block(jsonrpc_stream_open(argv[1], &stream), &stream); if (error) { ovs_fatal(error, "could not open \"%s\"", argv[1]); } @@ -326,7 +327,7 @@ do_notify(int argc UNUSED, char *argv[]) } static void -do_help(int argc UNUSED, char *argv[] UNUSED) +do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) { usage(); }