Merge "libutils: Remove a little dead code" am: 4a39ba316f
am: 0a8e5126ef
am: 9637277417
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1977026 Change-Id: I116b48dfb7e3dad536dc4c84ab0243e5167f3836
This commit is contained in:
commit
74402be9d1
|
@ -299,21 +299,16 @@ void androidSetCreateThreadFunc(android_create_thread_fn func)
|
||||||
int androidSetThreadPriority(pid_t tid, int pri)
|
int androidSetThreadPriority(pid_t tid, int pri)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int lasterr = 0;
|
|
||||||
int curr_pri = getpriority(PRIO_PROCESS, tid);
|
int curr_pri = getpriority(PRIO_PROCESS, tid);
|
||||||
|
|
||||||
if (curr_pri == pri) {
|
if (curr_pri == pri) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc) {
|
|
||||||
lasterr = errno;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (setpriority(PRIO_PROCESS, tid, pri) < 0) {
|
if (setpriority(PRIO_PROCESS, tid, pri) < 0) {
|
||||||
rc = INVALID_OPERATION;
|
rc = INVALID_OPERATION;
|
||||||
} else {
|
} else {
|
||||||
errno = lasterr;
|
errno = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in New Issue