Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11421


Change subject: ipaccess-config: Fix open() return value checking
......................................................................

ipaccess-config: Fix open() return value checking

open() returning 0 is valid, but negative values indicate errors.

Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Fixes: Coverity CID#57865
---
M src/ipaccess/ipaccess-config.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/11421/1

diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index 079bae2..5491700 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -634,7 +634,7 @@
        INIT_LLIST_HEAD(entry);

        fd = open(filename, O_RDONLY);
-       if (!fd) {
+       if (fd < 0) {
                perror("nada");
                return -1;
        }
@@ -729,7 +729,7 @@

        printf("Opening possible firmware '%s'\n", filename);
        fd = open(filename, O_RDONLY);
-       if (!fd) {
+       if (fd < 0) {
                perror("nada");
                return;
        }

--
To view, visit https://gerrit.osmocom.org/11421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Gerrit-Change-Number: 11421
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <[email protected]>

Reply via email to