2
http://bugs.debian.org/456586
3
http://boinc.berkeley.edu/trac/ticket/521
5
Index: b/client/hostinfo_unix.C
6
===================================================================
7
--- a/client/hostinfo_unix.C
8
+++ b/client/hostinfo_unix.C
10
#include <machine/cpuconf.h>
13
+// The following is intended to be true both on Linux
14
+// and Debian GNU/kFreeBSD (see trac #521)
16
+#define LINUX_LIKE_SYSTEM defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
18
// functions to get name/addr of local host
20
// Converts a int ip address to a string representation (i.e. "66.218.71.198")
22
time_data = localtime( &cur_time );
23
// tm_gmtoff is already adjusted for daylight savings time
24
return time_data->tm_gmtoff;
26
+#elif LINUX_LIKE_SYSTEM
27
return -1*(__timezone);
28
#elif defined(__CYGWIN32__)
29
return -1*(_timezone);
35
+#elif LINUX_LIKE_SYSTEM
38
FILE* fapm = fopen("/proc/apm", "r");
44
+#if LINUX_LIKE_SYSTEM
45
static void parse_meminfo_linux(HOST_INFO& host) {
49
strlcpy(host.p_model, model_buf, sizeof(host.p_model));
53
+#endif // LINUX_LIKE_SYSTEM
56
static void get_cpu_info_maxosx(HOST_INFO& host) {
58
get_filesystem_info(d_total, d_free);
60
///////////// p_vendor, p_model, p_features /////////////////
62
+#if LINUX_LIKE_SYSTEM
63
parse_cpuinfo_linux(*this);
64
#elif defined( __APPLE__)
67
DosQuerySysInfo( QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulMem, sizeof(ulMem));
71
+#elif LINUX_LIKE_SYSTEM
72
parse_meminfo_linux(*this);
73
#elif defined(_SC_USEABLE_MEMORY)
75
Index: b/client/main.C
76
===================================================================
80
int main(int argc, char** argv) {
83
+ // TODO: clean up the following
93
+#elif defined(__APPLE__)
94
+ // If the real user ID is root, we are executing as a daemon
95
+ if (getuid() == (uid_t)0) {
96
+ gstate.executing_as_daemon = true;
98
+#elif defined __EMX__
103
for (i=1; i<argc; i++) {
104
if (strcmp(argv[i], "-daemon") == 0 || strcmp(argv[i], "--daemon") == 0) {
105
syslog(LOG_DAEMON|LOG_INFO,
106
- "Starting Boinc-Daemon, listening on port %d.", GUI_RPC_PORT
107
+ "Starting BOINC as daemon, listening on port %d.", GUI_RPC_PORT
110
// Detach from the controlling terminal and run in the background as system daemon.
112
"To change ownership/permission, reinstall BOINC"
114
" or run\n the shell script Mac_SA_Secure.sh"
117
" or run\n the shell script secure.sh"
119
". (Error code %d)\n", i
120
Index: b/configure.ac
121
===================================================================
125
dnl than subtract them. If you need to remove something from the list above,
126
dnl please add it to the lists below...
128
- *-linux*) STATIC_LIB_LIST="${STATIC_LIB_LIST} nsl"
129
+ *-linux*|*-k*bsd*-gnu) STATIC_LIB_LIST="${STATIC_LIB_LIST} nsl"
131
*-solaris*) STATIC_LIB_LIST="${STATIC_LIB_LIST} X* ssl crypto"