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

Commit 044be6bc authored by Greg Kaiser's avatar Greg Kaiser
Browse files

libutils: Remove a little dead code

With our recent change 0455a2c3,
there's some logic that can be simplified to make this slightly
easier to read.

This CL does not change the behavior of this code.

Bug: 208895940
Test: TreeHugger
Change-Id: I4de2dbaf4406cbb7785df8839bb3ae453186ea69
parent eb710bfa
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -299,21 +299,16 @@ void androidSetCreateThreadFunc(android_create_thread_fn func)
int androidSetThreadPriority(pid_t tid, int pri)
{
    int rc = 0;
    int lasterr = 0;
    int curr_pri = getpriority(PRIO_PROCESS, tid);

    if (curr_pri == pri) {
        return rc;
    }

    if (rc) {
        lasterr = errno;
    }

    if (setpriority(PRIO_PROCESS, tid, pri) < 0) {
        rc = INVALID_OPERATION;
    } else {
        errno = lasterr;
        errno = 0;
    }

    return rc;