diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-11-02 08:46:40 -0500 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-11-02 08:46:40 -0500 |
commit | fd5dd6605adfa15c28eb16c9081e1df977724c78 (patch) | |
tree | 378d459d02164efff71e3bef02869b34d8502048 /darwin | |
parent | b669540e4e5b62f639146f6c373c131319631e6e (diff) | |
parent | cd3d2337f839c496e98ebc8633c1c0c0b961bb66 (diff) |
Merge pull request #299 from mmcco/master
OpenBSD port updates and error exit improvements
Diffstat (limited to 'darwin')
-rw-r--r-- | darwin/DarwinProcessList.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index 47904beb..27f6d3f8 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -41,14 +41,14 @@ void ProcessList_getHostInfo(host_basic_info_data_t *p) { mach_msg_type_number_t info_size = HOST_BASIC_INFO_COUNT; if(0 != host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)p, &info_size)) { - err(2, "Unable to retrieve host info\n"); + CRT_fatalError("Unable to retrieve host info\n"); } } void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p) { if(NULL != p && NULL != *p) { if(0 != munmap(*p, vm_page_size)) { - err(8, "Unable to free old CPU load information\n"); + CRT_fatalError("Unable to free old CPU load information\n"); } } @@ -61,7 +61,7 @@ unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p) { // TODO Improving the accuracy of the load counts woule help a lot. if(0 != host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &cpu_count, (processor_info_array_t *)p, &info_size)) { - err(4, "Unable to retrieve CPU info\n"); + CRT_fatalError("Unable to retrieve CPU info\n"); } return cpu_count; @@ -71,7 +71,7 @@ void ProcessList_getVMStats(vm_statistics64_t p) { mach_msg_type_number_t info_size = HOST_VM_INFO64_COUNT; if (host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info_t)p, &info_size) != 0) - err(9, "Unable to retrieve VM statistics\n"); + CRT_fatalError("Unable to retrieve VM statistics\n"); } struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count) { @@ -84,14 +84,14 @@ struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count) { */ *count = 0; if (sysctl(mib, 4, NULL, count, NULL, 0) < 0) - err(5, "Unable to get size of kproc_infos"); + CRT_fatalError("Unable to get size of kproc_infos"); processes = malloc(*count); if (processes == NULL) - errx(6, "Out of memory for kproc_infos"); + CRT_fatalError("Out of memory for kproc_infos"); if (sysctl(mib, 4, processes, count, NULL, 0) < 0) - err(7, "Unable to get kinfo_procs"); + CRT_fatalError("Unable to get kinfo_procs"); *count = *count / sizeof(struct kinfo_proc); |