Update for handling negative returned status from functions
call.
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
struct timeval tv;
info->fd = socket(AF_UNIX, SOCK_STREAM, 0);
- if (info->fd == -1) {
+ if (info->fd < 0) {
RTE_LOG(ERR, CHANNEL_MANAGER, "Error(%s) creating socket for '%s'\n",
strerror(errno),
info->channel_path);
int flags;
info->fd = open(info->channel_path, O_RDWR | O_RSYNC);
- if (info->fd == -1) {
+ if (info->fd < 0) {
RTE_LOG(ERR, CHANNEL_MANAGER, "Error(%s) opening fifo for '%s'\n",
strerror(errno),
info->channel_path);
/* Copy the contents of *pkt into the policy.pkt */
policies[i].pkt = *pkt;
get_pcpu_to_control(&policies[i]);
- if (get_pfid(&policies[i]) == -1) {
+ if (get_pfid(&policies[i]) < 0) {
updated = 1;
break;
}
if (policies[i].enabled == 0) {
policies[i].pkt = *pkt;
get_pcpu_to_control(&policies[i]);
- if (get_pfid(&policies[i]) == -1)
+ if (get_pfid(&policies[i]) < 0)
break;
core_share_status(i);
policies[i].enabled = 1;
buffer, buffer_len);
if (n_bytes == buffer_len)
break;
- if (n_bytes == -1) {
+ if (n_bytes < 0) {
err = errno;
RTE_LOG(DEBUG, CHANNEL_MONITOR,
"Received error on "