From: Sebastian Harl Date: Wed, 25 Jun 2014 21:07:50 +0000 (+0200) Subject: sysdb: Wait for remaining data after the mainloop terminates. X-Git-Tag: sysdb-0.2.0~34 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1bbb0664ecaed4eeb492d0faae79ca8c5d9f6435;p=sysdb.git sysdb: Wait for remaining data after the mainloop terminates. --- diff --git a/src/tools/sysdb/main.c b/src/tools/sysdb/main.c index 05c5b9f..fc226f9 100644 --- a/src/tools/sysdb/main.c +++ b/src/tools/sysdb/main.c @@ -328,6 +328,12 @@ main(int argc, char **argv) sdb_input_init(&input); sdb_input_mainloop(); + sdb_client_shutdown(input.client, SHUT_WR); + while (! sdb_client_eof(input.client)) { + /* wait for remaining data to arrive */ + sdb_command_print_reply(input.client); + } + if (hist_file[0] != '\0') { errno = 0; if (write_history(hist_file)) {