Package: boinc-client
Version: 5.10.27-1
Severity: normal
Tags: patch, sid

When running boinc-client, I noticed it reporting an odd amount of memory
in stdoutdae.txt:

02-Dec-2007 21:10:12 [---] Memory: 477.64 GB physical, 0 bytes virtual

...and I certainly do not have over 400G of physical memory in my laptop.

This is because the routines for detecting available memory don't get
called because they are '#ifdef linux'ed out. The attached patch changes
these linux-specific macro checks to glibc/gnu ones.

-- System Information:
Debian Release: lenny/sid
Architecture: kfreebsd-i386 (i686)

Kernel: kFreeBSD 6.2-1-486
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/bash

Versions of packages boinc-client depends on:
ii  adduser               3.105              add and remove users and groups
ii  ca-certificates       20070303           Common CA Certificates PEM files
ii  debconf [debconf-2.0] 1.5.17             Debian configuration management sy
ii  libc0.1               2.6.1-6            GNU C Library: Shared libraries
ii  libcurl3              7.17.1-1           Multi-protocol file transfer libra
ii  libgcc1               1:4.2.2-3          GCC support library
ii  libidn11              1.1-1              GNU libidn library, implementation
ii  libkrb53              1.6.dfsg.3~beta1-2 MIT Kerberos runtime libraries
ii  libldap2              2.1.30.dfsg-13.5   OpenLDAP libraries
ii  libssh2-1             0.18-1             SSH2 client-side library
ii  libssl0.9.8           0.9.8g-3           SSL shared libraries
ii  libstdc++6            4.2.2-3            The GNU Standard C++ Library v3
ii  lsb-base              3.1-24             Linux Standard Base 3.1 init scrip
ii  python                2.4.4-6            An interactive high-level object-o
ii  zlib1g                1:1.2.3.3.dfsg-7   compression library - runtime

boinc-client recommends no packages.

-- debconf information excluded
diff -Nru boinc-5.10.27.orig/client/hostinfo_unix.C boinc-5.10.27/client/hostinfo_unix.C
--- boinc-5.10.27.orig/client/hostinfo_unix.C	2007-10-24 14:12:05.000000000 -0500
+++ boinc-5.10.27/client/hostinfo_unix.C	2007-11-27 15:52:17.000000000 -0600
@@ -132,7 +132,7 @@
     time_data = localtime( &cur_time );
     // tm_gmtoff is already adjusted for daylight savings time
     return time_data->tm_gmtoff;
-#elif defined(linux)
+#elif defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
     return -1*(__timezone);
 #elif defined(__CYGWIN32__)
     return -1*(_timezone);
@@ -173,7 +173,7 @@
   CFRelease(list);
   return(retval);
 
-#elif defined(linux)
+#elif defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
     bool    retval = false;
 
     FILE* fapm = fopen("/proc/apm", "r");
@@ -237,7 +237,7 @@
 #endif
 }
 
-#ifdef linux
+#if defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
 static void parse_meminfo_linux(HOST_INFO& host) {
     char buf[256];
     double x;
@@ -449,7 +449,7 @@
     strlcpy(host.p_model, model_buf, sizeof(host.p_model));
     fclose(f);
 }
-#endif  // linux
+#endif  // __linux__ || __GNU__ || __GLIBC__
 
 #ifdef __APPLE__
 static void get_cpu_info_maxosx(HOST_INFO& host) {
@@ -520,7 +520,7 @@
     get_filesystem_info(d_total, d_free);
 
 ///////////// p_vendor, p_model, p_features /////////////////
-#ifdef linux
+#if defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
     parse_cpuinfo_linux(*this);
 #elif defined( __APPLE__)
     int mib[2];
@@ -604,7 +604,7 @@
         DosQuerySysInfo( QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulMem, sizeof(ulMem));
         m_swap = ulMem;
     }
-#elif defined(linux)
+#elif defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
     parse_meminfo_linux(*this);
 #elif defined(_SC_USEABLE_MEMORY)
     // UnixWare
diff -Nru boinc-5.10.27.orig/client/main.C boinc-5.10.27/client/main.C
--- boinc-5.10.27.orig/client/main.C	2007-03-19 15:03:06.000000000 -0500
+++ boinc-5.10.27/client/main.C	2007-11-27 15:41:16.000000000 -0600
@@ -641,7 +641,7 @@
             break;
         }
     }
-#elif defined linux
+#elif defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
     int i;
     
     for (i=1; i<argc; i++) {
@@ -734,7 +734,7 @@
             "To change ownership/permission, reinstall BOINC"
 #ifdef __APPLE__
             " or run\n the shell script Mac_SA_Secure.sh"
-#elif defined linux
+#elif defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
             " or run\n the shell script secure.sh"
 #endif
             ". (Error code %d)\n", i
diff -Nru boinc-5.10.27.orig/configure.ac boinc-5.10.27/configure.ac
--- boinc-5.10.27.orig/configure.ac	2007-10-24 14:12:05.000000000 -0500
+++ boinc-5.10.27/configure.ac	2007-11-27 15:34:12.000000000 -0600
@@ -230,7 +230,7 @@
 dnl than subtract them.  If you need to remove something from the list above,
 dnl please add it to the lists below...
 case ${target} in
-	*-linux*)	STATIC_LIB_LIST="${STATIC_LIB_LIST} nsl"
+	*-linux*|*-k*bsd*-gnu)	STATIC_LIB_LIST="${STATIC_LIB_LIST} nsl"
 	;;
 	*-solaris*)	STATIC_LIB_LIST="${STATIC_LIB_LIST} X* ssl crypto"
 	;;

Reply via email to