Correct wrong error check on return value from a socket() call. 0 is a
valid return, and treating it as an error could result in trouble.

Signed-off-by: Mark Rustad <[email protected]>
Tested-by: Ross Brattain <[email protected]>

---
fcoemon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fcoemon.c b/fcoemon.c
index 0d3459a..07c5b3c 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -596,7 +596,7 @@ static void fcm_vlan_dev_real_dev(char *vlan_ifname, char 
*real_ifname)
 
        fd = socket(PF_INET, SOCK_DGRAM, 0);
 
-       if (fd <= 0) {
+       if (fd < 0) {
                FCM_LOG_ERR(errno, "open vlan query socket error");
                return;
        }

_______________________________________________
devel mailing list
[email protected]
https://lists.open-fcoe.org/mailman/listinfo/devel

Reply via email to