diff --git a/checkin_notes b/checkin_notes index ae1027aaa7f73848c5d32a1c319b9335ef7f3678..a1134b535bdd02daffe870ffd77c2f6a1602c655 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8883,3 +8883,9 @@ David 31 Oct 2009 clientgui AdvancedFrame.cpp ProjectProcessingPage.cpp + +Rom 4 Nov 2009 + - client: Fix linux build break. + + client + cs_platforms.cpp diff --git a/client/cs_platforms.cpp b/client/cs_platforms.cpp index 8120a663af046d17872297bbe9166c487cb87eee..72f8d846ec28022eb65c41394af25496f3ea5676 100644 --- a/client/cs_platforms.cpp +++ b/client/cs_platforms.cpp @@ -125,69 +125,70 @@ void CLIENT_STATE::detect_platforms() { strlcat(cmdline," -m",256); if ((f=popen(cmdline,"r"))) { while (!std::feof(f)) { - fgets(cmdline,256,f); - if (strstr(cmdline,"x86_64")) support64=1; + fgets(cmdline,256,f); + if (strstr(cmdline,"x86_64")) support64=1; + } + pclose(f); } - pclose(f); - } - - if (!support64) { - // we're running on a 32 bit kernel, so we will assume - // we are i686-pc-linux-gnu only. - support32=1; - } else { - // we're running on a 64 bit kernel. - // Now comes the hard part. How to tell whether we can run - // 32-bit binaries. + + if (!support64) { + // we're running on a 32 bit kernel, so we will assume + // we are i686-pc-linux-gnu only. + support32=1; + } else { + // we're running on a 64 bit kernel. + // Now comes the hard part. How to tell whether we can run + // 32-bit binaries. #if defined(__i386__) && !defined(__x86_64__) - // If we're a 32 bit binary, then we obviously can. - support32=1; + // If we're a 32 bit binary, then we obviously can. + support32=1; #else - // If we're a 64 bit binary, the check is a bit harder. - // We'll use the file command to check installation of - // 32 bit libraries or executables. - const char *file[]={"/usr/bin/file","/bin/file",0}; - 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; - for (i=0; i < nlibdirs; i++) { - struct dirent *entry; - DIR *a = opendir(libdir[i]); - // if dir doesn't exist, do to the next one - if (a == 0) continue; - // dir exists. read each entry until you find a 32bit lib - while ((support32 == 0) && ((entry=readdir(a)) != 0)) { - strlcpy(cmdline, file[eno], 256); - strlcat(cmdline, " -L ", 256); - strlcat(cmdline, libdir[i], 256); - strlcat(cmdline, "/", 256); - strlcat(cmdline, entry->d_name, 256); - 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; - } - pclose(f); - } + // If we're a 64 bit binary, the check is a bit harder. + // We'll use the file command to check installation of + // 32 bit libraries or executables. + const char *file[]={"/usr/bin/file","/bin/file",0}; + 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; + for (i=0; i < nlibdirs; i++) { + struct dirent *entry; + DIR *a = opendir(libdir[i]); + // if dir doesn't exist, do to the next one + if (a == 0) continue; + // dir exists. read each entry until you find a 32bit lib + while ((support32 == 0) && ((entry=readdir(a)) != 0)) { + strlcpy(cmdline, file[eno], 256); + strlcat(cmdline, " -L ", 256); + strlcat(cmdline, libdir[i], 256); + strlcat(cmdline, "/", 256); + strlcat(cmdline, entry->d_name, 256); + 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; + } + pclose(f); + } + } + closedir(a); + if (support32) break; } - closedir(a); - if (support32) break; - } - } + } #endif - } + } + } if (support64) { add_platform("x86_64-pc-linux-gnu"); @@ -272,6 +273,7 @@ void CLIENT_STATE::detect_platforms() { #endif // !defined(UNKNOWN_SOLARIS_PROCESSOR) #else + // Any other platform, fall back to the previous method add_platform(HOSTTYPE); #ifdef HOSTTYPEALT