From 15d9a1045da36a709cc7b56f327253de6249e57f Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 10 Apr 2014 17:50:53 +0200 Subject: [PATCH] sysdb: Let sdb_command_print_reply() accept client instead of input objects. This is more flexible. --- src/tools/sysdb/command.c | 8 ++++---- src/tools/sysdb/command.h | 2 +- src/tools/sysdb/input.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tools/sysdb/command.c b/src/tools/sysdb/command.c index 1128c38..c79259e 100644 --- a/src/tools/sysdb/command.c +++ b/src/tools/sysdb/command.c @@ -47,7 +47,7 @@ */ int -sdb_command_print_reply(sdb_input_t *input) +sdb_command_print_reply(sdb_client_t *client) { sdb_strbuf_t *recv_buf; const char *result; @@ -57,10 +57,10 @@ sdb_command_print_reply(sdb_input_t *input) if (! recv_buf) return -1; - if (sdb_client_recv(input->client, &rcode, recv_buf) < 0) + if (sdb_client_recv(client, &rcode, recv_buf) < 0) rcode = UINT32_MAX; - if (sdb_client_eof(input->client)) + if (sdb_client_eof(client)) return -1; if (rcode == UINT32_MAX) @@ -103,7 +103,7 @@ sdb_command_exec(sdb_input_t *input) /* ignore errors; we'll only hide the command from the caller */ sdb_client_send(input->client, CONNECTION_QUERY, query_len, query); - if (sdb_command_print_reply(input)) + if (sdb_command_print_reply(input->client)) return NULL; } diff --git a/src/tools/sysdb/command.h b/src/tools/sysdb/command.h index 726e27a..febf64f 100644 --- a/src/tools/sysdb/command.h +++ b/src/tools/sysdb/command.h @@ -39,7 +39,7 @@ * - a negative value else */ int -sdb_command_print_reply(sdb_input_t *input); +sdb_command_print_reply(sdb_client_t *client); /* * sdb_command_exec: diff --git a/src/tools/sysdb/input.c b/src/tools/sysdb/input.c index 3814f0c..b515c4e 100644 --- a/src/tools/sysdb/input.c +++ b/src/tools/sysdb/input.c @@ -190,7 +190,7 @@ input_readline(void) /* some response / error message from the server pending */ /* XXX: clear current line */ printf("\n"); - sdb_command_print_reply(sysdb_input); + sdb_command_print_reply(sysdb_input->client); rl_forced_update_display(); } -- 2.30.2