power-libperfmgr: ADPF: use errno to check the failure type
Bug: 296159697
Test: Manual
Change-Id: Idb74d12fd0d1028514382a4e09116b506b5ec176
diff --git a/power-libperfmgr/aidl/PowerSessionManager.cpp b/power-libperfmgr/aidl/PowerSessionManager.cpp
index 830818c..2d2aad2 100644
--- a/power-libperfmgr/aidl/PowerSessionManager.cpp
+++ b/power-libperfmgr/aidl/PowerSessionManager.cpp
@@ -72,7 +72,7 @@
int ret = sched_setattr(tid, &attr, 0);
if (ret) {
- if (ret == ESRCH) {
+ if (errno == ESRCH) {
ALOGV("sched_setattr failed for thread %d, err=%d", tid, errno);
} else {
ALOGW("sched_setattr failed for thread %d, err=%d", tid, errno);