From f8e7bc60361fa22f048b204b822de6ab357211b3 Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 7 Dec 2023 23:55:33 +0100 Subject: [PATCH] spot the first problem --- dev_evdev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dev_evdev.c b/dev_evdev.c index 5075c5b..8a7adcd 100644 --- a/dev_evdev.c +++ b/dev_evdev.c @@ -57,9 +57,10 @@ int dev_evdev_open( int open_sysfs_idx = -1; - res = pthread_mutex_lock(&input_acquire_mutex); - if (res != 0) { - fprintf(stderr, "Cannot lock input mutex: %d\n", res); + const int mutex_lock_res = pthread_mutex_lock(&input_acquire_mutex); + if (mutex_lock_res != 0) { + fprintf(stderr, "Cannot lock input mutex: %d\n", mutex_lock_res); + res = mutex_lock_res; goto dev_evdev_open_err; }