diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-10-31 16:57:43 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-10-31 16:59:24 +0100 |
commit | 4a1f2d3866defbdc9386b52051c1d8540a8db451 (patch) | |
tree | 34c488c1f9ca6499b7d4ab5b239242ec2fd3fc4b /proc | |
parent | 7719472e3410d009c89d775ea05dc7f305d9ebce (diff) | |
download | hurd-4a1f2d3866defbdc9386b52051c1d8540a8db451.tar.gz hurd-4a1f2d3866defbdc9386b52051c1d8540a8db451.tar.bz2 hurd-4a1f2d3866defbdc9386b52051c1d8540a8db451.zip |
proc: do not set last_processor on thread_info() error
* proc/info.c (S_proc_getprocinfo): Only set last_processor field when
err == 0.
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 |