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

Commit b02f9449 authored by T.J. Mercier's avatar T.J. Mercier
Browse files

libprocessgroup: Don't sleep after last cgroup removal attempt

Currently we sleep for 5ms before decrementing retries for the last
time. This is a waste of time, so bail out of the loop if the last
rmdir attempt fails.

Change-Id: Ia20840d27592b4eb3d9762647b19c111ff94209f
parent 5a2d8514
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ static int RemoveProcessGroup(const char* cgroup, uid_t uid, int pid, unsigned i

    while (retries--) {
        ret = rmdir(uid_pid_path.c_str());
        if (!ret || errno != EBUSY) break;
        if (!ret || errno != EBUSY || !retries) break;
        std::this_thread::sleep_for(5ms);
    }