From d65af565bf4cb7a1d21063825e6155be7fd8e35d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 18 Jun 2004 19:08:42 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3663 --- client/cs_cmdline.C | 1 + client/hostinfo_network.C | 23 ++++++++++++++++++++++- client/ss_logic.C | 6 ++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/client/cs_cmdline.C b/client/cs_cmdline.C index 994adc40b8..ed94eef4fe 100644 --- a/client/cs_cmdline.C +++ b/client/cs_cmdline.C @@ -41,6 +41,7 @@ static void print_options(char* prog) { #endif " -exit_when_idle Get/process/report work, then exit\n" " -show_projects show attached projects\n" + " -return_results_immediately contact server when have results\n" " -detach_project URL detach from a project\n" " -reset_project URL reset (clear) a project\n" " -attach_project attach to a project (will prompt for URL, account key)\n" diff --git a/client/hostinfo_network.C b/client/hostinfo_network.C index 53a6572017..a837ab51d2 100644 --- a/client/hostinfo_network.C +++ b/client/hostinfo_network.C @@ -73,6 +73,26 @@ int get_local_network_info( #else +// NEW POLICY: on UNIX, get just the hostname. +// the rest (domain name, IP address) is a can of worms, +// and doesn't really matter anyway + +int get_local_network_info( + char* domain_name, int domlen, char* ip_addr, int iplen +) { + char hostname[256]; + char buf[256]; + int retval; + + strcpy(domain_name, "unknown"); + strcpy(ip_addr, "unknown"); + if (!gethostname(hostname, 256)) { + safe_strncpy(domain_name, hostname, domlen); + } + return 0; +} + +#if 0 // gethostbyname() is a linkage nightmare on UNIX systems (go figure) // so use a kludge instead: run ping and parse the output. // The output should have a line like @@ -106,7 +126,7 @@ static int try_ping( if (!p) continue; p++; if (!strchr(p, '.')) continue; - safe_strncpy(domain_name, p, sizeof(domain_name)); + safe_strncpy(domain_name, p, domlen); return 0; } return ERR_NULL; @@ -141,5 +161,6 @@ int get_local_network_info( return 0; } +#endif #endif diff --git a/client/ss_logic.C b/client/ss_logic.C index 3a7964453d..ef5b6cf84e 100644 --- a/client/ss_logic.C +++ b/client/ss_logic.C @@ -107,14 +107,12 @@ void SS_LOGIC::poll() { ack_deadline = time(0) + 5; } else { do_boinc_logo_ss = true; - strcpy(ss_msg, "No work available"); + strcpy(ss_msg, "No graphics-capable applications running"); } } } } - } - else - { + } else { do_boinc_logo_ss = true; strcpy(ss_msg, "App can't display graphics, BOINC Suspended"); }