Harald Welte has submitted this change and it was merged. (
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(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
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: merged
Gerrit-Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Gerrit-Change-Number: 11421
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)