diff options
author | Ben Pfaff <blp@nicira.com> | 2013-01-24 13:46:23 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-02-01 14:27:13 -0800 |
commit | 2bf1d3cc12de50fe05a2a61780ce2450be532084 (patch) | |
tree | 8891bf3661422a2264293aca5b81451e36258381 /lib | |
parent | 8450059ee8c1564f5d3be2e5d9c303360d1226e4 (diff) |
unixctl: Use ovs_retval_to_string() where EOF is a possible value.
jsonrpc_transact_block() might return EOF so passing its return value to
strerror() isn't general enough.
It might be better to change jsonrpc_transact{_block}() to never return
EOF, since a closed connection seems like it is always an error in that
context.
Found by Coverity.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unixctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/unixctl.c b/lib/unixctl.c index e59056ef..104a2d9a 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. @@ -462,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; } |