X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Ftools%2Fsysdb%2Fcommand.c;h=be41b15f9d92557588df6b9fefc326a261a80844;hp=7cbde41a7e05e1bff9f6c3f0dfd5d966dda62e8f;hb=1f2aedf19e878c5cbf6d5bc5793ee3621fa7854c;hpb=8c58d65dec8e046ec1d8b26eb1a6d913b971e5be diff --git a/src/tools/sysdb/command.c b/src/tools/sysdb/command.c index 7cbde41..be41b15 100644 --- a/src/tools/sysdb/command.c +++ b/src/tools/sysdb/command.c @@ -58,19 +58,19 @@ sdb_command_print_reply(sdb_client_t *client) if (! recv_buf) return -1; - if (sdb_client_recv(client, &rcode, recv_buf) < 0) { + if (sdb_client_recv(client, &rcode, recv_buf) < 0) rcode = UINT32_MAX; - status = -1; - } if (sdb_client_eof(client)) return -1; - if (rcode == CONNECTION_ERROR) - status = CONNECTION_ERROR; - - if (rcode == UINT32_MAX) + if (rcode == UINT32_MAX) { printf("ERROR: "); + status = -1; + } + else + status = (int)rcode; + result = sdb_strbuf_string(recv_buf); if (result && *result) printf("%s\n", result);