power: fix error messages
Function strerror(errno) has built strings only for non-negative errno values. for negative values of errno it describe error as "Unknown error -errno" to be more descriptive i put string "channel not found" taken from header. The negative argument will be interpreted as a very large unsigned value. Coverity issue: 13266 Coverity issue: 13269 Fixes: 445c6528b55f ("power: common interface for guest and host") Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
This commit is contained in:
parent
c4936eee7a
commit
f87a9ddc4a
@ -103,8 +103,10 @@ guest_channel_host_connect(const char *path, unsigned lcore_id)
|
||||
global_fds[lcore_id] = fd;
|
||||
ret = guest_channel_send_msg(&pkt, lcore_id);
|
||||
if (ret != 0) {
|
||||
RTE_LOG(ERR, GUEST_CHANNEL, "Error on channel '%s' communications "
|
||||
"test: %s\n", fd_path, strerror(ret));
|
||||
RTE_LOG(ERR, GUEST_CHANNEL,
|
||||
"Error on channel '%s' communications test: %s\n",
|
||||
fd_path, ret > 0 ? strerror(ret) :
|
||||
"channel not connected");
|
||||
goto error;
|
||||
}
|
||||
RTE_LOG(INFO, GUEST_CHANNEL, "Channel '%s' is now connected\n", fd_path);
|
||||
|
@ -106,7 +106,8 @@ send_msg(unsigned lcore_id, uint32_t scale_direction)
|
||||
ret = guest_channel_send_msg(&pkt[lcore_id], lcore_id);
|
||||
if (ret == 0)
|
||||
return 1;
|
||||
RTE_LOG(DEBUG, POWER, "Error sending message: %s\n", strerror(ret));
|
||||
RTE_LOG(DEBUG, POWER, "Error sending message: %s\n",
|
||||
ret > 0 ? strerror(ret) : "channel not connected");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user