Use a loop instead of a goto in sysctl_kern_proc_kstack().
MFC after: 3 days
This commit is contained in:
parent
806ab8645b
commit
5af0054863
@ -2534,10 +2534,8 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS)
|
|||||||
st = stack_create();
|
st = stack_create();
|
||||||
|
|
||||||
lwpidarray = NULL;
|
lwpidarray = NULL;
|
||||||
numthreads = 0;
|
|
||||||
PROC_LOCK(p);
|
PROC_LOCK(p);
|
||||||
repeat:
|
do {
|
||||||
if (numthreads < p->p_numthreads) {
|
|
||||||
if (lwpidarray != NULL) {
|
if (lwpidarray != NULL) {
|
||||||
free(lwpidarray, M_TEMP);
|
free(lwpidarray, M_TEMP);
|
||||||
lwpidarray = NULL;
|
lwpidarray = NULL;
|
||||||
@ -2547,9 +2545,7 @@ repeat:
|
|||||||
lwpidarray = malloc(sizeof(*lwpidarray) * numthreads, M_TEMP,
|
lwpidarray = malloc(sizeof(*lwpidarray) * numthreads, M_TEMP,
|
||||||
M_WAITOK | M_ZERO);
|
M_WAITOK | M_ZERO);
|
||||||
PROC_LOCK(p);
|
PROC_LOCK(p);
|
||||||
goto repeat;
|
} while (numthreads < p->p_numthreads);
|
||||||
}
|
|
||||||
i = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXXRW: During the below loop, execve(2) and countless other sorts
|
* XXXRW: During the below loop, execve(2) and countless other sorts
|
||||||
@ -2560,6 +2556,7 @@ repeat:
|
|||||||
* have changed, in which case the right to extract debug info might
|
* have changed, in which case the right to extract debug info might
|
||||||
* no longer be assured.
|
* no longer be assured.
|
||||||
*/
|
*/
|
||||||
|
i = 0;
|
||||||
FOREACH_THREAD_IN_PROC(p, td) {
|
FOREACH_THREAD_IN_PROC(p, td) {
|
||||||
KASSERT(i < numthreads,
|
KASSERT(i < numthreads,
|
||||||
("sysctl_kern_proc_kstack: numthreads"));
|
("sysctl_kern_proc_kstack: numthreads"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user