]> git.droids-corp.org - dpdk.git/blobdiff - examples/vm_power_manager/channel_manager.c
power: update error handling
[dpdk.git] / examples / vm_power_manager / channel_manager.c
index de1a8689190e58c279d09e337e31458d9735c533..09bfa5c0d3888adfd4d6bfd5b0ebd08f0e530497 100644 (file)
@@ -224,7 +224,7 @@ open_non_blocking_channel(struct channel_info *info)
        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);
@@ -285,7 +285,7 @@ open_host_channel(struct channel_info *info)
        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);