Code

sysdb: Handle EOF from the server.
[sysdb.git] / src / tools / sysdb / command.c
index 0abf381e95527234d8e2ef8aa608e25d3446c9ad..1128c388e8bbd827f63e63cb2cd2628137e146fd 100644 (file)
@@ -60,6 +60,9 @@ sdb_command_print_reply(sdb_input_t *input)
        if (sdb_client_recv(input->client, &rcode, recv_buf) < 0)
                rcode = UINT32_MAX;
 
+       if (sdb_client_eof(input->client))
+               return -1;
+
        if (rcode == UINT32_MAX)
                printf("ERROR: ");
        result = sdb_strbuf_string(recv_buf);