summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac6c1fc)
raw | patch | inline | side by side (parent: ac6c1fc)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 6 Feb 2014 19:11:45 +0000 (20:11 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 6 Feb 2014 19:11:45 +0000 (20:11 +0100) |
src/tools/sysdb/command.c | patch | blob | history | |
src/tools/sysdb/input.c | patch | blob | history |
index 0abf381e95527234d8e2ef8aa608e25d3446c9ad..1128c388e8bbd827f63e63cb2cd2628137e146fd 100644 (file)
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);
index f115e3e2a51088efdf2dec9e5547ffa1a60642cc..3814f0c2def7a239d8397d9cad4558cbd52112ae 100644 (file)
--- a/src/tools/sysdb/input.c
+++ b/src/tools/sysdb/input.c
#include "tools/sysdb/input.h"
#include "tools/sysdb/command.h"
+#include "utils/error.h"
#include "utils/strbuf.h"
#include <sys/select.h>
if (! FD_ISSET(client_fd, &fds))
continue;
+ if (sdb_client_eof(sysdb_input->client)) {
+ /* XXX: try to reconnect */
+ printf("\n");
+ sdb_log(SDB_LOG_ERR, "Remote side closed the connection.");
+ /* return EOF */
+ return 0;
+ }
+
/* some response / error message from the server pending */
/* XXX: clear current line */
printf("\n");