Fix bugs reported by Coverity and SVACE 19/280219/1
authorUnsung Lee <unsung.lee@samsung.com>
Thu, 25 Aug 2022 08:33:05 +0000 (17:33 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Thu, 25 Aug 2022 08:49:48 +0000 (17:49 +0900)
Change-Id: I716175c16073e627a52a62176b2341c2b612953e
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/plugin/plugin.c

index 587fbd23e796b012eae4e445c49c1a03a08ec563..73d49900da203d8cc24cc98c0291cf465effb592 100644 (file)
@@ -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: