diff options
author | Benny Baumann <BenBE@geshi.org> | 2020-11-01 01:09:51 +0100 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2020-11-02 22:15:01 +0100 |
commit | 45869513bfebba80cc2ab42e4218f68b34b1e6ac (patch) | |
tree | f064631dbff141bf1c945db8cff40b7bb82fd169 /darwin | |
parent | 61e14d4bb25268593019e6df3eb02264b4ac8e0e (diff) |
Embracing branches
Diffstat (limited to 'darwin')
-rw-r--r-- | darwin/DarwinProcessList.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index 673d9e61..99f49d5c 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -110,15 +110,18 @@ struct kinfo_proc* ProcessList_getKInfoProcs(size_t* count) { * process entry or two. */ *count = 0; - if (sysctl(mib, 4, NULL, count, NULL, 0) < 0) + if (sysctl(mib, 4, NULL, count, NULL, 0) < 0) { CRT_fatalError("Unable to get size of kproc_infos"); + } processes = xMalloc(*count); - if (processes == NULL) + if (processes == NULL) { CRT_fatalError("Out of memory for kproc_infos"); + } - if (sysctl(mib, 4, processes, count, NULL, 0) < 0) + if (sysctl(mib, 4, processes, count, NULL, 0) < 0) { CRT_fatalError("Unable to get kinfo_procs"); + } *count = *count / sizeof(struct kinfo_proc); |