Date: Mon, 25 Apr 2016 18:13:21 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298588 - stable/10/sys/kern Message-ID: <201604251813.u3PIDLrP057440@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Apr 25 18:13:21 2016 New Revision: 298588 URL: https://svnweb.freebsd.org/changeset/base/298588 Log: MFC r298173: Use a loop instead of a goto in sysctl_kern_proc_kstack(). Modified: stable/10/sys/kern/kern_proc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Mon Apr 25 18:09:36 2016 (r298587) +++ stable/10/sys/kern/kern_proc.c Mon Apr 25 18:13:21 2016 (r298588) @@ -2462,10 +2462,8 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_A st = stack_create(); lwpidarray = NULL; - numthreads = 0; PROC_LOCK(p); -repeat: - if (numthreads < p->p_numthreads) { + do { if (lwpidarray != NULL) { free(lwpidarray, M_TEMP); lwpidarray = NULL; @@ -2475,9 +2473,7 @@ repeat: lwpidarray = malloc(sizeof(*lwpidarray) * numthreads, M_TEMP, M_WAITOK | M_ZERO); PROC_LOCK(p); - goto repeat; - } - i = 0; + } while (numthreads < p->p_numthreads); /* * XXXRW: During the below loop, execve(2) and countless other sorts @@ -2488,6 +2484,7 @@ repeat: * have changed, in which case the right to extract debug info might * no longer be assured. */ + i = 0; FOREACH_THREAD_IN_PROC(p, td) { KASSERT(i < numthreads, ("sysctl_kern_proc_kstack: numthreads"));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604251813.u3PIDLrP057440>