From: Unsung Lee Date: Thu, 25 Aug 2022 08:33:05 +0000 (+0900) Subject: Fix bugs reported by Coverity and SVACE X-Git-Tag: submit/tizen_6.5/20220901.095941 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen_6.5%2F20220901.095941;p=platform%2Fcore%2Fapi%2Fresource.git Fix bugs reported by Coverity and SVACE Change-Id: I716175c16073e627a52a62176b2341c2b612953e Signed-off-by: Unsung Lee (cherry picked from commit 936b3dfceec70f2a700c587d54aa2ac793a11991) --- diff --git a/src/plugin/plugin.c b/src/plugin/plugin.c index 587fbd2..73d4990 100644 --- a/src/plugin/plugin.c +++ b/src/plugin/plugin.c @@ -238,7 +238,9 @@ API int resource_get_cpu_boosting_level (resource_pid_t pid, struct timeval tv; tv.tv_sec = 3; - setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)&tv, sizeof(tv)); + tv.tv_usec = 0; + if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)&tv, sizeof(tv)) < 0) + _E("[CPU-BOOSTING-PLUGIN] Failed to set timeout of receive (error = %m)"); memset(&output, 0, sizeof(output)); retry_header: