summaryrefslogtreecommitdiffstats
path: root/lib/elf_py.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-05-02 15:25:04 +0200
committerDonald Sharp <sharpd@nvidia.com>2023-07-24 19:31:37 +0200
commit0b74cd002c8252746f6f0296d586115cc287ab7e (patch)
treeab65dca04ee29a18ce7350fae8a4f602d5526e70 /lib/elf_py.c
parentMerge pull request #14076 from chiragshah6/fdev1 (diff)
downloadfrr-0b74cd002c8252746f6f0296d586115cc287ab7e.tar.xz
frr-0b74cd002c8252746f6f0296d586115cc287ab7e.zip
lib: Fix elf_py.c for coverity
David rightly pointed out that having a test for fd > 0 would technically not be right, but not wrong for this portion of the code since we know that we would never get a fd = 0 in this section. In any event let's make coverity happy and move on with our life. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/elf_py.c')
-rw-r--r--lib/elf_py.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/elf_py.c b/lib/elf_py.c
index d473dc10c..81ca668e7 100644
--- a/lib/elf_py.c
+++ b/lib/elf_py.c
@@ -1140,7 +1140,7 @@ static PyObject *elffile_load(PyTypeObject *type, PyObject *args,
fd = open(filename, O_RDONLY | O_NOCTTY);
if (fd < 0 || fstat(fd, &st)) {
PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
- if (fd > 0)
+ if (fd >= 0)
close(fd);
goto out;
}