From: Jaehyun Cho Date: Fri, 27 Aug 2021 05:55:15 +0000 (+0900) Subject: eina_thread: check if pthread_getschedparam fails X-Git-Tag: accepted/tizen/unified/20210901.103715^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a911e92d4eeb73c2800d7b0970292e4c379d4ed;p=platform%2Fupstream%2Fefl.git eina_thread: check if pthread_getschedparam fails The return value of pthread_getschedparam is checked to know if it fails. Change-Id: Idef27abcdfc2de0dfcf6e746edaf2230258c3eed --- diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c index 18e7ac5..9dde953 100644 --- a/src/lib/eina/eina_thread.c +++ b/src/lib/eina/eina_thread.c @@ -154,7 +154,11 @@ _eina_internal_call(void *context) int pol = SCHED_IDLE; #else int pol; - pthread_getschedparam(self, &pol, ¶ms); + int err = pthread_getschedparam(self, &pol, ¶ms); + if (err != 0) + { + EINA_LOG_ERR("pthread_getschedparam failed: %d", err); + } #endif min = sched_get_priority_min(pol); params.sched_priority = min; @@ -168,7 +172,11 @@ _eina_internal_call(void *context) int pol = SCHED_BATCH; #else int pol; - pthread_getschedparam(self, &pol, ¶ms); + int err = pthread_getschedparam(self, &pol, ¶ms); + if (err != 0) + { + EINA_LOG_ERR("pthread_getschedparam failed: %d", err); + } #endif min = sched_get_priority_min(pol); max = sched_get_priority_max(pol); @@ -183,8 +191,11 @@ _eina_internal_call(void *context) { struct sched_param params; int max, pol; - - pthread_getschedparam(self, &pol, ¶ms); + int err = pthread_getschedparam(self, &pol, ¶ms); + if (err != 0) + { + EINA_LOG_ERR("pthread_getschedparam failed: %d", err); + } max = sched_get_priority_max(pol); params.sched_priority += 5; if (params.sched_priority > max) params.sched_priority = max;