X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-appctl.c;h=9fd0234e3a46dceb9e8d36537c8d267053c92f19;hb=a797eab3d57910765fd1515600feb4ffe20b31ce;hp=241b6c04377be5be9fba3b75e78efde4c07ab541;hpb=bde9f75de100e3801735bf69f605320f4db65cba;p=sliver-openvswitch.git diff --git a/utilities/ovs-appctl.c b/utilities/ovs-appctl.c index 241b6c043..9fd0234e3 100644 --- a/utilities/ovs-appctl.c +++ b/utilities/ovs-appctl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,7 @@ main(int argc, char *argv[]) } else if (cmd_result) { fputs(cmd_result, stdout); } else { - NOT_REACHED(); + OVS_NOT_REACHED(); } jsonrpc_close(client); @@ -97,6 +97,7 @@ Common commands:\n\ 'off', 'emer', 'err', 'warn', 'info', or 'dbg' ('dbg', bydefault)\n\ vlog/reopen Make the program reopen its log file\n\ Other options:\n\ + --timeout=SECS wait at most SECS seconds for a response\n\ -h, --help Print this helpful information\n\ -V, --version Display ovs-appctl version information\n", program_name, program_name); @@ -111,6 +112,7 @@ parse_command_line(int argc, char *argv[]) {"execute", no_argument, NULL, 'e'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, + {"timeout", required_argument, NULL, 'T'}, {NULL, 0, NULL, 0}, }; const char *target; @@ -147,6 +149,10 @@ parse_command_line(int argc, char *argv[]) usage(); break; + case 'T': + time_alarm(atoi(optarg)); + break; + case 'V': ovs_print_version(0, 0); exit(EXIT_SUCCESS); @@ -155,7 +161,7 @@ parse_command_line(int argc, char *argv[]) exit(EXIT_FAILURE); default: - NOT_REACHED(); + OVS_NOT_REACHED(); } }