diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-11-02 16:00:03 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-11-02 16:00:03 +0100 |
commit | 610c428cf8c9340d955c79cd2daca3ed8657f2b1 (patch) | |
tree | 864de76b1d318fa6f1d28cb78ade52461335cf1c /exec | |
parent | 673603dae49fd06de782780a38e2914ed8cd8777 (diff) |
Fix proc_getprocinfo calls
The deallocation also needs to be fixed.
Also, fetch_procinfo already took care of the conversion.
* exec/elfcore.c (dump_core): Fix procinfoCnt taken from
proc_getprocinfo.
* utils/login.c (check_owned): Likewise.
* libps/procstat.c (merge_procinfo): Remove conversion between bytes and
int, already handled by fetch_procinfo.
Diffstat (limited to 'exec')
-rw-r--r-- | exec/elfcore.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/exec/elfcore.c b/exec/elfcore.c index 033604c9..ff38a3ca 100644 --- a/exec/elfcore.c +++ b/exec/elfcore.c @@ -334,7 +334,7 @@ dump_core (task_t task, file_t file, off_t corelimit, mach_msg_type_number_t num_waits = 0; char pibuf[offsetof (struct procinfo, threadinfos[2])]; struct procinfo *pi = (void *) &pibuf; - mach_msg_type_number_t pi_size = sizeof pibuf / sizeof(*(procinfo_t*)0); + mach_msg_type_number_t pi_size = sizeof pibuf / sizeof (*(procinfo_t*)0); memset (&pstatus.data, 0, sizeof pstatus.data); memset (&psinfo.data, 0, sizeof psinfo.data); @@ -395,7 +395,7 @@ dump_core (task_t task, file_t file, off_t corelimit, psinfo.data.pr_wstat = pi->exitstatus; if ((void *) pi != &pibuf) - munmap (pi, pi_size); + munmap (pi, pi_size * sizeof (*(procinfo_t*) 0)); } if (err == 0) { |