X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-client.c;h=0991e7146c8c978d62f64c72313ef6155ce209c4;hb=1e68c0730d0753e9a796a0d6d4b95933f7cdfbd2;hp=65d6d81dd4e005f3fb727a50ec79189ee0c8f7df;hpb=58fda1dab104041fc693032475ec4662c1a52849;p=openvswitch diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index 65d6d81d..0991e714 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -27,6 +27,7 @@ #include "command-line.h" #include "column.h" #include "compiler.h" +#include "daemon.h" #include "dynamic-string.h" #include "json.h" #include "jsonrpc.h" @@ -80,6 +81,7 @@ parse_options(int argc, char *argv[]) {"verbose", optional_argument, 0, 'v'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, + DAEMON_LONG_OPTIONS, {0, 0, 0, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -121,6 +123,8 @@ parse_options(int argc, char *argv[]) vlog_set_verbosity(optarg); break; + DAEMON_OPTION_HANDLERS + case '?': exit(EXIT_FAILURE); @@ -160,6 +164,7 @@ usage(void) " (\"table\", \"html\", or \"csv\"\n" " --wide don't limit TTY lines to 79 bytes\n" " --no-headings omit table heading row\n"); + daemon_usage(); vlog_usage(); printf("\nOther options:\n" " -h, --help display this help message\n" @@ -814,6 +819,8 @@ do_monitor(int argc, char *argv[]) } else if (msg->type == JSONRPC_REPLY && json_equal(msg->id, request_id)) { monitor_print(msg->result, table, &columns, true); + fflush(stdout); + daemonize(); } else if (msg->type == JSONRPC_NOTIFY && !strcmp(msg->method, "update")) { struct json *params = msg->params; @@ -822,6 +829,7 @@ do_monitor(int argc, char *argv[]) && params->u.array.elems[0]->type == JSON_NULL) { monitor_print(params->u.array.elems[1], table, &columns, false); + fflush(stdout); } } }