From 2bf1d3cc12de50fe05a2a61780ce2450be532084 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 24 Jan 2013 13:46:23 -0800 Subject: [PATCH] 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 Acked-by: Ethan Jackson --- lib/unixctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/unixctl.c b/lib/unixctl.c index e59056ef2..104a2d9a3 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; } -- 2.47.0