Skip to content
Snippets Groups Projects
Commit 62051719 authored by Rom Walton's avatar Rom Walton
Browse files

- client: cleanup formatting of linux platform detection code.

    
    client/
        cs_platforms.cpp

svn path=/trunk/boinc/; revision=19384
parent 6c6f8cd3
No related branches found
No related tags found
No related merge requests found
......@@ -8790,3 +8790,9 @@ Charlie 26 Oct 2009
clientgui/
sg_BoincSimpleGUI.cpp, .h
Rom 26 Oct 2009
- client: cleanup formatting of linux platform detection code.
client/
cs_platforms.cpp
......@@ -118,6 +118,7 @@ void CLIENT_STATE::detect_platforms() {
do {
if (boinc_file_exists(uname[eno])) break;
} while (uname[++eno] != 0);
// run it and check the kernel machine architecture.
if ( uname[eno] != 0 ) {
strlcpy(cmdline,uname[eno],256);
......@@ -129,6 +130,7 @@ void CLIENT_STATE::detect_platforms() {
}
pclose(f);
}
if (!support64) {
// we're running on a 32 bit kernel, so we will assume
// we are i686-pc-linux-gnu only.
......@@ -148,12 +150,12 @@ void CLIENT_STATE::detect_platforms() {
const char *libdir[]={"/lib","/lib32","/lib/32","/usr/lib","/usr/lib32","/usr/lib/32"};
const int nlibdirs=sizeof(libdir)/sizeof(char *);
// find 'file'
eno=0;
do {
if (boinc_file_exists(file[eno])) break;
} while (file[++eno] != 0);
// now try to find a 32-bit C library.
if (file[eno] != 0) {
int i;
......@@ -169,13 +171,13 @@ void CLIENT_STATE::detect_platforms() {
strlcat(cmdline, libdir[i], 256);
strlcat(cmdline, "/", 256);
strlcat(cmdline, entry->d_name, 256);
if ((f=popen(cmdline,"r"))) {
f = popen(cmdline, "r");
if (f) {
while (!std::feof(f)) {
fgets(cmdline,256,f);
// If the library is 32-bit ELF, then we're
// golden.
if (strstr(cmdline,"ELF") &&
strstr(cmdline,"32-bit")) support32=1;
if (strstr(cmdline, "ELF") && strstr(cmdline, "32-bit")) support32=1;
}
pclose(f);
}
......@@ -186,7 +188,6 @@ void CLIENT_STATE::detect_platforms() {
}
#endif
}
}
if (support64) {
add_platform("x86_64-pc-linux-gnu");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment