diff options
Diffstat (limited to 'proc')
-rw-r--r-- | proc/info.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/proc/info.c b/proc/info.c index 93a18d39..6c2567d2 100644 --- a/proc/info.c +++ b/proc/info.c @@ -701,6 +701,15 @@ S_proc_getprocinfo (struct proc *callerp, err = thread_info (thds[i], THREAD_SCHED_INFO, (thread_info_t) &pi->threadinfos[i].pis_si, &thcount); + +#ifdef HAVE_STRUCT_THREAD_SCHED_INFO_LAST_PROCESSOR + if (err == 0) + /* If the structure read doesn't include last_processor field, assume + CPU 0. */ + if (thcount < 8) + pi->threadinfos[i].pis_si.last_processor = 0; +#endif + if (err == MACH_SEND_INVALID_DEST) { pi->threadinfos[i].died = 1; @@ -714,13 +723,6 @@ S_proc_getprocinfo (struct proc *callerp, err = 0; } -#ifdef HAVE_STRUCT_THREAD_SCHED_INFO_LAST_PROCESSOR - /* If the structure read doesn't include last_processor field, assume - CPU 0. */ - if (thcount < 8) - pi->threadinfos[i].pis_si.last_processor = 0; -#endif - } /* Note that there are thread wait entries only for those threads |