X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Ftools%2Fsysdb%2Fcommand.c;h=7cbde41a7e05e1bff9f6c3f0dfd5d966dda62e8f;hp=77f3c8346498c430be10fcbafcf1ab9a06ee5cc2;hb=8c58d65dec8e046ec1d8b26eb1a6d913b971e5be;hpb=42af3b662e70584b49ada6949f278bbaa5fd435b diff --git a/src/tools/sysdb/command.c b/src/tools/sysdb/command.c index 77f3c83..7cbde41 100644 --- a/src/tools/sysdb/command.c +++ b/src/tools/sysdb/command.c @@ -67,7 +67,7 @@ sdb_command_print_reply(sdb_client_t *client) return -1; if (rcode == CONNECTION_ERROR) - status = 1; + status = CONNECTION_ERROR; if (rcode == UINT32_MAX) printf("ERROR: "); @@ -109,6 +109,12 @@ 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); + + /* The server will send back *something*, either error/log messages + * and/or the reply to the query. Here, we don't care about what it + * sends back. We'll wait for the first reply and then return to the + * main loop which will handle any subsequent replies, including + * eventually the reply to the query (if it's not the first reply). */ if (sdb_command_print_reply(input->client) < 0) return NULL; }