- kern_sched_rr_get_interval should return interval for thread 1 in
target process. - eliminate a goto. MFC after: 1 week
This commit is contained in:
parent
ec92603cf9
commit
931e4573df
@ -219,10 +219,8 @@ sched_getscheduler(struct thread *td, struct sched_getscheduler_args *uap)
|
||||
PROC_LOCK(targetp);
|
||||
} else {
|
||||
targetp = pfind(uap->pid);
|
||||
if (targetp == NULL) {
|
||||
e = ESRCH;
|
||||
goto done2;
|
||||
}
|
||||
if (targetp == NULL)
|
||||
return (ESRCH);
|
||||
targettd = FIRST_THREAD_IN_PROC(targetp);
|
||||
}
|
||||
|
||||
@ -233,7 +231,6 @@ sched_getscheduler(struct thread *td, struct sched_getscheduler_args *uap)
|
||||
}
|
||||
PROC_UNLOCK(targetp);
|
||||
|
||||
done2:
|
||||
return (e);
|
||||
}
|
||||
|
||||
@ -293,13 +290,10 @@ kern_sched_rr_get_interval(struct thread *td, pid_t pid,
|
||||
targetp = td->td_proc;
|
||||
PROC_LOCK(targetp);
|
||||
} else {
|
||||
targetp = td->td_proc;
|
||||
PROC_LOCK(targetp);
|
||||
targettd = thread_find(targetp, pid);
|
||||
if (targettd == NULL) {
|
||||
PROC_UNLOCK(targetp);
|
||||
targetp = pfind(pid);
|
||||
if (targetp == NULL)
|
||||
return (ESRCH);
|
||||
}
|
||||
targettd = FIRST_THREAD_IN_PROC(targetp);
|
||||
}
|
||||
|
||||
e = p_cansee(td, targetp);
|
||||
|
Loading…
Reference in New Issue
Block a user