0 is a valid file descriptor.
---
 tests/checkasm/checkasm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 4311a8ffcb..1da0877be5 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -317,7 +317,9 @@ static struct {
     const char *cpu_flag_name;
     const char *test_name;
     int verbose;
-} state;
+} state = {
+    .sysfd = -1,
+};
 
 /* PRNG state */
 AVLFG checkasm_lfg;
@@ -710,7 +712,7 @@ static int bench_init(void)
 static void bench_uninit(void)
 {
 #if CONFIG_LINUX_PERF
-    if (state.sysfd > 0)
+    if (state.sysfd != -1)
         close(state.sysfd);
 #endif
 }
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to