~ubuntu-branches/ubuntu/lucid/boinc/lucid

« back to all changes in this revision

Viewing changes to debian/patches/101_fix_memory_detection_on_kfreebsd.patch

  • Committer: Bazaar Package Importer
  • Author(s): Frank S. Thomas, Frank S. Thomas
  • Date: 2008-05-31 08:02:47 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080531080247-4ce890lp2rc768cr
Tags: 6.2.7-1
[ Frank S. Thomas ]
* New upstream release.
  - BOINC Manager: Redraw disk usage charts immediately after connecting to
    a (different) client. (closes: 463823)
* debian/copyright:
  - Added the instructions from debian/README.Debian-source about how
    repackaged BOINC tarballs can be reproduced because DevRef now
    recommends to put this here instead of in the afore-mentioned file.
  - Updated for the new release.
* Removed the obsolete debian/README.Debian-source.
* For consistency upstream renamed the core client and the command tool
  ("boinc_client" to "boinc" and "boinc_cmd" to "boinccmd"). Done the same
  in all packages and created symlinks with the old names for the binaries
  and man pages. Also added an entry in debian/boinc-client.NEWS explaining
  this change.
* debian/rules: Do not list Makefile.ins in the clean target individually,
  just remove all that can be found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
This patch fixes:
2
 
http://bugs.debian.org/456586
3
 
http://boinc.berkeley.edu/trac/ticket/521
4
 
 
5
 
Index: b/client/hostinfo_unix.C
6
 
===================================================================
7
 
--- a/client/hostinfo_unix.C
8
 
+++ b/client/hostinfo_unix.C
9
 
@@ -107,6 +107,11 @@
10
 
 #include <machine/cpuconf.h>
11
 
 #endif
12
 
 
13
 
+// The following is intended to be true both on Linux
14
 
+// and Debian GNU/kFreeBSD (see trac #521)
15
 
+//
16
 
+#define LINUX_LIKE_SYSTEM defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
17
 
+
18
 
 // functions to get name/addr of local host
19
 
 
20
 
 // Converts a int ip address to a string representation (i.e. "66.218.71.198")
21
 
@@ -134,7 +139,7 @@
22
 
     time_data = localtime( &cur_time );
23
 
     // tm_gmtoff is already adjusted for daylight savings time
24
 
     return time_data->tm_gmtoff;
25
 
-#elif defined(linux)
26
 
+#elif LINUX_LIKE_SYSTEM
27
 
     return -1*(__timezone);
28
 
 #elif defined(__CYGWIN32__)
29
 
     return -1*(_timezone);
30
 
@@ -175,7 +180,7 @@
31
 
   CFRelease(list);
32
 
   return(retval);
33
 
 
34
 
-#elif defined(linux)
35
 
+#elif LINUX_LIKE_SYSTEM
36
 
     bool    retval = false;
37
 
 
38
 
     FILE* fapm = fopen("/proc/apm", "r");
39
 
@@ -239,7 +244,7 @@
40
 
 #endif
41
 
 }
42
 
 
43
 
-#ifdef linux
44
 
+#if LINUX_LIKE_SYSTEM
45
 
 static void parse_meminfo_linux(HOST_INFO& host) {
46
 
     char buf[256];
47
 
     double x;
48
 
@@ -451,7 +456,7 @@
49
 
     strlcpy(host.p_model, model_buf, sizeof(host.p_model));
50
 
     fclose(f);
51
 
 }
52
 
-#endif  // linux
53
 
+#endif  // LINUX_LIKE_SYSTEM
54
 
 
55
 
 #ifdef __APPLE__
56
 
 static void get_cpu_info_maxosx(HOST_INFO& host) {
57
 
@@ -522,7 +527,7 @@
58
 
     get_filesystem_info(d_total, d_free);
59
 
 
60
 
 ///////////// p_vendor, p_model, p_features /////////////////
61
 
-#ifdef linux
62
 
+#if LINUX_LIKE_SYSTEM
63
 
     parse_cpuinfo_linux(*this);
64
 
 #elif defined( __APPLE__)
65
 
     int mib[2];
66
 
@@ -606,7 +611,7 @@
67
 
         DosQuerySysInfo( QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulMem, sizeof(ulMem));
68
 
         m_swap = ulMem;
69
 
     }
70
 
-#elif defined(linux)
71
 
+#elif LINUX_LIKE_SYSTEM
72
 
     parse_meminfo_linux(*this);
73
 
 #elif defined(_SC_USEABLE_MEMORY)
74
 
     // UnixWare
75
 
Index: b/client/main.C
76
 
===================================================================
77
 
--- a/client/main.C
78
 
+++ b/client/main.C
79
 
@@ -564,6 +564,8 @@
80
 
 int main(int argc, char** argv) {
81
 
     int retval = 0;
82
 
 
83
 
+    // TODO: clean up the following
84
 
+    //
85
 
 #ifdef _WIN32
86
 
     int i, len;
87
 
     char *commandLine;
88
 
@@ -627,13 +629,20 @@
89
 
             break;
90
 
         }
91
 
     }
92
 
-#elif defined linux
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;
97
 
+    }
98
 
+#elif defined __EMX__
99
 
+#else
100
 
+    // non-Apple Unix
101
 
     int i;
102
 
     
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
108
 
             );
109
 
             // from <unistd.h>:
110
 
             // Detach from the controlling terminal and run in the background as system daemon.
111
 
@@ -717,7 +726,7 @@
112
 
             "To change ownership/permission, reinstall BOINC"
113
 
 #ifdef __APPLE__
114
 
             " or run\n the shell script Mac_SA_Secure.sh"
115
 
-#elif defined linux
116
 
+#else
117
 
             " or run\n the shell script secure.sh"
118
 
 #endif
119
 
             ". (Error code %d)\n", i
120
 
Index: b/configure.ac
121
 
===================================================================
122
 
--- a/configure.ac
123
 
+++ b/configure.ac
124
 
@@ -230,7 +230,7 @@
125
 
 dnl than subtract them.  If you need to remove something from the list above,
126
 
 dnl please add it to the lists below...
127
 
 case ${target} in
128
 
-       *-linux*)       STATIC_LIB_LIST="${STATIC_LIB_LIST} nsl"
129
 
+       *-linux*|*-k*bsd*-gnu)  STATIC_LIB_LIST="${STATIC_LIB_LIST} nsl"
130
 
        ;;
131
 
        *-solaris*)     STATIC_LIB_LIST="${STATIC_LIB_LIST} X* ssl crypto"
132
 
        ;;