Code

sysdb: Wait for remaining data after the mainloop terminates.
authorSebastian Harl <sh@tokkee.org>
Wed, 25 Jun 2014 21:07:50 +0000 (23:07 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 25 Jun 2014 21:07:50 +0000 (23:07 +0200)
src/tools/sysdb/main.c

index 05c5b9fb6d6ce6f6d57cb45f04666dff37e775a7..fc226f965f991ec65f4cc4bbfa5b61f7ba318e57 100644 (file)
@@ -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)) {