X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Funixctl.c;h=253e9538915fdbec860c3a31f9d46a4e77a2f3c3;hb=0141e875a14cc30fe9c207a83616861055531d4d;hp=4ab493d48775ea0504b57d4f4233b52c7f3483a9;hpb=e0edde6fee279cdbbf3c179f5f50adaf0c7c7f1e;p=sliver-openvswitch.git diff --git a/lib/unixctl.c b/lib/unixctl.c index 4ab493d48..253e95389 100644 --- a/lib/unixctl.c +++ b/lib/unixctl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ #include #include "unixctl.h" -#include #include #include #include "coverage.h" @@ -95,13 +94,13 @@ unixctl_version(struct unixctl_conn *conn, int argc OVS_UNUSED, * arguments to the command; it is used only for presentation to the user in * "help" output. * - * 'cb' is called when the command is received. It is passed the actual set of - * arguments, as a text string, plus a copy of 'aux'. Normally 'cb' should - * reply by calling unixctl_command_reply() or unixctl_command_reply_error() - * before it returns, but if the command cannot be handled immediately then it - * can defer the reply until later. A given connection can only process a - * single request at a time, so a reply must be made eventually to avoid - * blocking that connection. */ + * 'cb' is called when the command is received. It is passed an array + * containing the command name and arguments, plus a copy of 'aux'. Normally + * 'cb' should reply by calling unixctl_command_reply() or + * unixctl_command_reply_error() before it returns, but if the command cannot + * be handled immediately then it can defer the reply until later. A given + * connection can only process a single request at a time, so a reply must be + * made eventually to avoid blocking that connection. */ void unixctl_command_register(const char *name, const char *usage, int min_args, int max_args, @@ -110,7 +109,7 @@ unixctl_command_register(const char *name, const char *usage, struct unixctl_command *command; struct unixctl_command *lookup = shash_find_data(&commands, name); - assert(!lookup || lookup->cb == cb); + ovs_assert(!lookup || lookup->cb == cb); if (lookup) { return; @@ -133,7 +132,7 @@ unixctl_command_reply__(struct unixctl_conn *conn, struct jsonrpc_msg *reply; COVERAGE_INC(unixctl_replied); - assert(conn->request_id); + ovs_assert(conn->request_id); if (!body) { body = ""; @@ -169,7 +168,7 @@ unixctl_command_reply(struct unixctl_conn *conn, const char *result) } /* Replies to the active unixctl connection 'conn'. 'error' is sent to the - * client indicating an error occured processing the command. Only one call to + * client indicating an error occurred processing the command. Only one call to * unixctl_command_reply() or unixctl_command_reply_error() may be made per * request. */ void @@ -359,7 +358,7 @@ unixctl_server_run(struct unixctl_server *server) } else { VLOG_WARN_RL(&rl, "%s: accept failed: %s", pstream_get_name(server->listener), - strerror(error)); + ovs_strerror(error)); } } @@ -463,7 +462,7 @@ unixctl_client_transact(struct jsonrpc *client, const char *command, int argc, error = jsonrpc_transact_block(client, request, &reply); if (error) { VLOG_WARN("error communicating with %s: %s", jsonrpc_get_name(client), - strerror(error)); + ovs_retval_to_string(error)); return error; }