- 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:
David Xu 2010-09-29 07:31:05 +00:00
parent ec92603cf9
commit 931e4573df
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213258

View File

@ -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);