X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/b093933aee94b9e565bd8c76aa206070ff80a961..301dd48127a2c8bd2c89226c3810d0c9820f819f:/usr/src/sys.386bsd/kern/kern_clock.c?ds=inline diff --git a/usr/src/sys.386bsd/kern/kern_clock.c b/usr/src/sys.386bsd/kern/kern_clock.c index 3d2a6acfc4..af7f75b393 100644 --- a/usr/src/sys.386bsd/kern/kern_clock.c +++ b/usr/src/sys.386bsd/kern/kern_clock.c @@ -276,7 +276,7 @@ gatherstats(framep) if (curproc == NULL && CLKF_BASEPRI(framep)) cpstate = CP_IDLE; #ifdef GPROF - s = CLKF_PC(framep) - s_lowpc; + s = (u_long) CLKF_PC(framep) - (u_long) s_lowpc; if (profiling < 2 && s < s_textsize) kcount[s / (HISTFRACTION * sizeof (*kcount))]++; #endif @@ -319,6 +319,12 @@ softclock(frame) splx(s); (*func)(arg, a); } + + /* + * If no process to work with, we're finished. + */ + if (curproc == 0) return; + /* * If trapped user-mode and profiling, give it * a profiling tick.