Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97957fc4 authored by Wei Wang's avatar Wei Wang
Browse files

libcutils: only change cgroup when fd is initialized

This is to avoid failues on setting non-exist cgroup

Bug: 34193533
Test: on marlin
Change-Id: I619dcba332fda9ec421df811745cf10311beddd3
parent a27a91a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -464,7 +464,7 @@ int set_sched_policy(int tid, SchedPolicy policy)
            break;
        }

        if (add_tid_to_cgroup(tid, fd) != 0) {
        if (fd > 0 && add_tid_to_cgroup(tid, fd) != 0) {
            if (errno != ESRCH && errno != ENOENT)
                return -errno;
        }