[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3976 - GNUnet/src/util/os
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3976 - GNUnet/src/util/os |
Date: |
Mon, 18 Dec 2006 10:51:51 -0800 (PST) |
Author: grothoff
Date: 2006-12-18 10:51:50 -0800 (Mon, 18 Dec 2006)
New Revision: 3976
Modified:
GNUnet/src/util/os/cpustatus.c
Log:
daemonization startup patch (from Heikki)
Modified: GNUnet/src/util/os/cpustatus.c
===================================================================
--- GNUnet/src/util/os/cpustatus.c 2006-12-18 18:46:25 UTC (rev 3975)
+++ GNUnet/src/util/os/cpustatus.c 2006-12-18 18:51:50 UTC (rev 3976)
@@ -57,7 +57,6 @@
#include <mach/mach.h>
#include <mach/mach_error.h>
-static host_name_port_t mhost;
static processor_cpu_load_info_t prev_cpu_load;
#endif
@@ -77,15 +76,14 @@
kern_return_t kret;
int i,j;
- mhost = mach_host_self();
- kret = host_processor_info(mhost, PROCESSOR_CPU_LOAD_INFO,
+ kret = host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO,
&cpu_count,
(processor_info_array_t *)&cpu_load,
&cpu_msg_count);
if (kret != KERN_SUCCESS) {
- GE_LOG_STRERROR(NULL,
- GE_ERROR | GE_USER | GE_ADMIN | GE_BULK,
- "host_processor_info");
+ GE_LOG(NULL,
+ GE_ERROR | GE_USER | GE_ADMIN | GE_BULK,
+ "host_processor_info failed.");
return SYSERR;
}
prev_cpu_load = (processor_cpu_load_info_t)MALLOC(cpu_count *
@@ -185,7 +183,7 @@
int i, j;
t_idle_all = t_total_all = 0;
- kret = host_processor_info(mhost, PROCESSOR_CPU_LOAD_INFO,
+ kret = host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO,
&cpu_count,
(processor_info_array_t *)&cpu_load,
&cpu_msg_count);
@@ -250,9 +248,9 @@
return currentLoad;
}
else {
- GE_LOG_STRERROR(NULL,
- GE_ERROR | GE_USER | GE_ADMIN | GE_BULK,
- "host_processor_info");
+ GE_LOG(NULL,
+ GE_ERROR | GE_USER | GE_ADMIN | GE_BULK,
+ "host_processor_info failed.");
}
}
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3976 - GNUnet/src/util/os,
grothoff <=