summaryrefslogtreecommitdiff
path: root/utils/login.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-02 16:00:03 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-02 16:00:03 +0100
commit610c428cf8c9340d955c79cd2daca3ed8657f2b1 (patch)
tree864de76b1d318fa6f1d28cb78ade52461335cf1c /utils/login.c
parent673603dae49fd06de782780a38e2914ed8cd8777 (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 'utils/login.c')
-rw-r--r--utils/login.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/login.c b/utils/login.c
index 40bc3f45..a3e05636 100644
--- a/utils/login.c
+++ b/utils/login.c
@@ -263,7 +263,7 @@ check_owned (process_t proc_server, pid_t pid, int *owned)
char *waits = 0;
mach_msg_type_number_t num_waits = 0;
struct procinfo _pi, *pi = &_pi;
- mach_msg_type_number_t pi_size = sizeof _pi / sizeof(*(procinfo_t)0);
+ mach_msg_type_number_t pi_size = sizeof _pi / sizeof (*(procinfo_t)0);
error_t err =
proc_getprocinfo (proc_server, pid, &flags, (procinfo_t *)&pi, &pi_size,
&waits, &num_waits);
@@ -272,7 +272,7 @@ check_owned (process_t proc_server, pid_t pid, int *owned)
{
*owned = !(pi->state & PI_NOTOWNED);
if (pi != &_pi)
- munmap (pi, pi_size);
+ munmap (pi, pi_size * sizeof (*(procinfo_t)0));
}
return err;