From: Sebastian Harl Date: Sat, 10 Jan 2015 13:03:36 +0000 (+0100) Subject: sysdb: Accept status=OK after sending a query. X-Git-Tag: sysdb-0.7.0~78 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e75ea8e047dada17cba57b4c4d586f655294026e;p=sysdb.git sysdb: Accept status=OK after sending a query. OK is sent back on successful STORE commands. --- diff --git a/src/tools/sysdb/command.c b/src/tools/sysdb/command.c index c809c1f..440ba41 100644 --- a/src/tools/sysdb/command.c +++ b/src/tools/sysdb/command.c @@ -46,6 +46,16 @@ #include #include +static void +ok_printer(sdb_strbuf_t *buf) +{ + const char *msg = sdb_strbuf_string(buf); + if (msg && *msg) + printf("%s\n", msg); + else + printf("OK\n"); +} /* ok_printer */ + static void log_printer(sdb_strbuf_t *buf) { @@ -86,6 +96,7 @@ static struct { int status; void (*printer)(sdb_strbuf_t *); } response_printers[] = { + { SDB_CONNECTION_OK, ok_printer }, { SDB_CONNECTION_LOG, log_printer }, { SDB_CONNECTION_DATA, data_printer }, }; @@ -195,7 +206,8 @@ sdb_command_exec(sdb_input_t *input) break; } - if ((status == SDB_CONNECTION_DATA) + if ((status == SDB_CONNECTION_OK) + || (status == SDB_CONNECTION_DATA) || (status == SDB_CONNECTION_ERROR)) break; }