Commit 3e98909a authored by David Anderson's avatar David Anderson

- client: adjust debts at least every minute.

    This fixes a bug that can cause debts to NEVER get updated.
- client: added "abort_jobs_on_exit" feature
    (available by --abort_jobs_on_exit cmdline
    or <abort_jobs_on_exit> in cc_config.xml).
    If set, when the client is exited by user request
    (this includes signals on Unix)
    it marks all pending jobs as aborted,
    and does a scheduler RPC to all projects with jobs.
    When these are completed the client exits.
    This is useful when BOINC is being used on grids
    where it is wiped clean after each run.

svn path=/trunk/boinc/; revision=17300
parent de1cd1dc
......@@ -1670,3 +1670,29 @@ David 18 Feb 2009
work_fetch.cpp
tools/
make_project
David 18 Feb 2009
- client: adjust debts at least every minute.
This fixes a bug that can cause debts to NEVER get updated.
- client: added "abort_jobs_on_exit" feature
(available by --abort_jobs_on_exit cmdline
or <abort_jobs_on_exit> in cc_config.xml).
If set, when the client is exited by user request
(this includes signals on Unix)
it marks all pending jobs as aborted,
and does a scheduler RPC to all projects with jobs.
When these are completed the client exits.
This is useful when BOINC is being used on grids
where it is wiped clean after each run.
client/
client_state.cpp,h
cpu_sched.cpp
cs_cmdline.cpp
cs_prefs.cpp
cs_scheduler.cpp
log_flags.cpp
main.cpp
work_fetch.cpp
lib/
error_numbers.h
......@@ -102,6 +102,7 @@ CLIENT_STATE::CLIENT_STATE():
network_mode.set(RUN_MODE_AUTO, 0);
started_by_screensaver = false;
requested_exit = false;
in_abort_sequence = false;
master_fetch_period = MASTER_FETCH_PERIOD;
retry_cap = RETRY_CAP;
master_fetch_retry_cap = MASTER_FETCH_RETRY_CAP;
......@@ -131,6 +132,7 @@ CLIENT_STATE::CLIENT_STATE():
launched_by_manager = false;
initialized = false;
last_wakeup_time = dtime();
abort_jobs_on_exit = false;
}
void CLIENT_STATE::show_proxy_info() {
......@@ -1588,13 +1590,11 @@ int CLIENT_STATE::detach_project(PROJECT* project) {
// e.g. flush buffers, but why bother)
//
int CLIENT_STATE::quit_activities() {
int retval;
// calculate long-term debts (for state file)
//
adjust_debts();
retval = active_tasks.exit_tasks();
int retval = active_tasks.exit_tasks();
if (retval) {
msg_printf(NULL, MSG_INTERNAL_ERROR,
"Couldn't exit tasks: %s", boincerror(retval)
......@@ -1657,4 +1657,35 @@ void CLIENT_STATE::check_clock_reset() {
// RESULT: could change report_deadline, but not clear how
}
// the following is done on client exit if the
// "abort_jobs_on_exit" flag is present.
// Abort jobs, and arrange to tell projects about it.
//
void CLIENT_STATE::start_abort_sequence() {
unsigned int i;
for (i=0; i<results.size(); i++) {
RESULT* rp = results[i];
rp->project->sched_rpc_pending = RPC_REASON_USER_REQ;
if (rp->computing_done()) continue;
ACTIVE_TASK* atp = lookup_active_task_by_result(rp);
if (atp) {
atp->abort_task(ERR_ABORTED_ON_EXIT, "aborting on client exit");
} else {
rp->abort_inactive(ERR_ABORTED_ON_EXIT);
}
}
}
// The second part of the above; check if RPCs are done
//
bool CLIENT_STATE::abort_sequence_done() {
unsigned int i;
for (i=0; i<projects.size(); i++) {
PROJECT* p = projects[i];
if (p->sched_rpc_pending == RPC_REASON_USER_REQ) return false;
}
return true;
}
const char *BOINC_RCSID_e836980ee1 = "$Id$";
......@@ -98,6 +98,7 @@ public:
int cmdline_gui_rpc_port;
bool show_projects;
bool requested_exit;
bool in_abort_sequence;
/// stores URL for -detach_project option
char detach_project_url[256];
/// stores URL for -reset_project option
......@@ -228,6 +229,9 @@ public:
int report_result_error(RESULT&, const char *format, ...);
int reset_project(PROJECT*, bool detaching);
bool no_gui_rpc;
bool abort_jobs_on_exit;
void start_abort_sequence();
bool abort_sequence_done();
private:
int link_app(PROJECT*, APP*);
int link_file_info(PROJECT*, FILE_INFO*);
......
......@@ -64,6 +64,9 @@ using std::vector;
#define DEADLINE_CUSHION 0
// try to finish jobs this much in advance of their deadline
#define CPU_SCHED_ENFORCE_PERIOD 60
// enforce CPU schedule at least this often
bool COPROCS::sufficient_coprocs(COPROCS& needed, bool log_flag, const char* prefix) {
for (unsigned int i=0; i<needed.coprocs.size(); i++) {
COPROC* cp = needed.coprocs[i];
......@@ -333,17 +336,17 @@ void CLIENT_STATE::adjust_debts() {
double share_frac;
double elapsed_time = now - debt_interval_start;
// This is called from WORK_FETCH::choose_project(),
// which runs about once every WORK_FETCH_PERIOD.
// If the elapsed time is more than 2*WORK_FETCH_PERIOD,
// This is called from enforce_schedule(),
// which runs about once every CPU_SCHED_ENFORCE_PERIOD seconds.
// If the elapsed time is more than 2*CPU_SCHED_ENFORCE_PERIOD
// it must be because the host was suspended for a long time.
// In this case, ignore the last period
//
if (elapsed_time > 2*WORK_FETCH_PERIOD || elapsed_time < 0) {
if (elapsed_time > 2*CPU_SCHED_ENFORCE_PERIOD || elapsed_time < 0) {
if (log_flags.debt_debug) {
msg_printf(NULL, MSG_INFO,
"[debt_debug] adjust_debt: elapsed time (%d) longer than work fetch period(%d). Ignoring this period.",
(int)elapsed_time, (int)WORK_FETCH_PERIOD
"[debt_debug] adjust_debt: elapsed time (%d) longer than sched enforce period(%d). Ignoring this period.",
(int)elapsed_time, (int)CPU_SCHED_ENFORCE_PERIOD
);
}
reset_debt_accounting();
......@@ -580,8 +583,6 @@ void CLIENT_STATE::schedule_cpus() {
print_deadline_misses();
}
adjust_debts();
// set temporary variables
//
for (i=0; i<results.size(); i++) {
......@@ -737,11 +738,12 @@ bool CLIENT_STATE::enforce_schedule() {
// Do this when requested, and once a minute as a safety net
//
if (now - last_time > 60) {
if (now - last_time > CPU_SCHED_ENFORCE_PERIOD) {
must_enforce_cpu_schedule = true;
}
if (!must_enforce_cpu_schedule) return false;
must_enforce_cpu_schedule = false;
adjust_debts();
last_time = now;
bool action = false;
......
......@@ -39,6 +39,7 @@ static void print_options(char* prog) {
"Run boinccmd in the same directory as %s.\n"
"\n"
"Usage: %s [options]\n"
" --abort_jobs_on_exit when client exits, abort and report jobs\n"
" --allow_remote_gui_rpc allow remote GUI RPC connections\n"
" --allow_multiple_clients allow >1 instances per host\n"
" --attach_project <URL> <key> attach to a project\n"
......@@ -48,9 +49,9 @@ static void print_options(char* prog) {
" --detach_project <URL> detach from a project\n"
" --dir <path> use given dir as BOINC home\n"
" --exit_after_app_start N exit N seconds after an app starts\n"
" --exit_after_finish exit right after finishing a job\n"
" --exit_before_start exit right before starting a job\n"
" --exit_before_upload exit right before starting an upload \n"
" --exit_after_finish exit right after finishing a job\n"
" --exit_when_idle exit when there are no results\n"
" --file_xfer_giveup_period N give up on file xfers after N sec\n"
" --gui_rpc_port <port> port for GUI RPCs\n"
......@@ -59,21 +60,21 @@ static void print_options(char* prog) {
" --insecure disable app sandboxing (Unix)\n"
#endif
" --launched_by_manager client was launched by Manager\n"
" --master_fetch_interval N limiting period of master retry\n"
" --master_fetch_period N reload master URL after N RPC failures\n"
" --master_fetch_retry_cap N exponential backoff limit\n"
" --master_fetch_interval N limiting period of master retry\n"
" --no_gui_rpc don't allow GUI RPC, don't make socket\n"
" --pers_giveup N giveup time for persistent file xfer\n"
" --pers_retry_delay_min N min for file xfer exponential backoff\n"
" --pers_retry_delay_max N max for file xfer exponential backoff\n"
" --reset_project <URL> reset (clear) a project\n"
" --pers_retry_delay_min N min for file xfer exponential backoff\n"
" --redirectio redirect stdout and stderr to log files\n"
" --reset_project <URL> reset (clear) a project\n"
" --retry_cap N exponential backoff limit\n"
" --run_cpu_benchmarks run the CPU benchmarks\n"
" --run_by_updater set by updater\n"
" --saver client was launched by screensaver\n"
" --sched_retry_delay_min N min for RPC exponential backoff\n"
" --sched_retry_delay_max N max for RPC exponential backoff\n"
" --sched_retry_delay_min N min for RPC exponential backoff\n"
" --show_projects show attached projects\n"
" --skip_cpu_benchmarks don't run CPU benchmarks\n"
" --start_delay X delay starting apps for X secs\n"
......@@ -99,125 +100,123 @@ void CLIENT_STATE::parse_cmdline(int argc, char** argv) {
int i;
bool show_options = false;
// NOTE: if you change or add anything, make the same chane
// in show_options() (above) and in doc/client.php
for (i=1; i<argc; i++) {
if (ARG(exit_when_idle)) {
exit_when_idle = true;
config.report_results_immediately = true;
} else if (ARG(exit_before_start)) {
exit_before_start = true;
} else if (ARG(exit_after_finish)) {
exit_after_finish = true;
if (0) {
} else if (ARG(abort_jobs_on_exit)) {
abort_jobs_on_exit = true;
} else if (ARG(allow_multiple_clients)) {
config.allow_multiple_clients = true;
} else if (ARG(allow_remote_gui_rpc)) {
allow_remote_gui_rpc = true;
} else if (ARG(attach_project)) {
if (i >= argc-2) {
show_options = true;
} else {
safe_strcpy(attach_project_url, argv[++i]);
safe_strcpy(attach_project_auth, argv[++i]);
}
} else if (ARG(check_all_logins)) {
check_all_logins = true;
} else if (ARG(daemon)) {
executing_as_daemon = true;
} else if (ARG(skip_cpu_benchmarks)) {
skip_cpu_benchmarks = true;
} else if (ARG(detach_phase_two)) {
detach_console = true;
} else if (ARG(detach_project)) {
if (i == argc-1) show_options = true;
else safe_strcpy(detach_project_url, argv[++i]);
} else if (ARG(dir)) {
if (i == argc-1) {
show_options = true;
} else {
if (chdir(argv[++i])) {
perror("chdir");
exit(1);
}
}
} else if (ARG(exit_after_app_start)) {
if (i == argc-1) show_options = true;
else exit_after_app_start_secs = atoi(argv[++i]);
} else if (ARG(exit_after_finish)) {
exit_after_finish = true;
} else if (ARG(exit_before_start)) {
exit_before_start = true;
} else if (ARG(exit_before_upload)) {
exit_before_upload = true;
} else if (ARG(exit_when_idle)) {
exit_when_idle = true;
config.report_results_immediately = true;
} else if (ARG(file_xfer_giveup_period)) {
if (i == argc-1) show_options = true;
else file_xfer_giveup_period = atoi(argv[++i]);
} else if (ARG(saver)) {
started_by_screensaver = true;
} else if (!strncmp(argv[i], "-psn_", strlen("-psn_"))) {
// ignore -psn argument on Mac OS X
} else if (ARG(exit_before_upload)) {
exit_before_upload = true;
// The following are only used for testing to alter scheduler/file transfer
// backoff rates
} else if (ARG(gui_rpc_port)) {
cmdline_gui_rpc_port = atoi(argv[++i]);
} else if (ARG(help)) {
print_options(argv[0]);
exit(0);
} else if (ARG(insecure)) {
#ifdef SANDBOX
g_use_sandbox = false;
#endif
} else if (ARG(launched_by_manager)) {
launched_by_manager = true;
} else if (ARG(master_fetch_interval)) {
if (i == argc-1) show_options = true;
else master_fetch_interval = atoi(argv[++i]);
} else if (ARG(master_fetch_period)) {
if (i == argc-1) show_options = true;
else master_fetch_period = atoi(argv[++i]);
} else if (ARG(retry_cap)) {
if (i == argc-1) show_options = true;
else retry_cap = atoi(argv[++i]);
} else if (ARG(master_fetch_retry_cap)) {
if (i == argc-1) show_options = true;
else master_fetch_retry_cap = atoi(argv[++i]);
} else if (ARG(master_fetch_interval)) {
if (i == argc-1) show_options = true;
else master_fetch_interval = atoi(argv[++i]);
} else if (ARG(sched_retry_delay_min)) {
} else if (ARG(no_gui_rpc)) {
no_gui_rpc = true;
} else if (ARG(pers_giveup)) {
if (i == argc-1) show_options = true;
else sched_retry_delay_min = atoi(argv[++i]);
} else if (ARG(sched_retry_delay_max)) {
else pers_giveup = atoi(argv[++i]);
} else if (ARG(pers_retry_delay_max)) {
if (i == argc-1) show_options = true;
else sched_retry_delay_max = atoi(argv[++i]);
else pers_retry_delay_max = atoi(argv[++i]);
} else if (ARG(pers_retry_delay_min)) {
if (i == argc-1) show_options = true;
else pers_retry_delay_min = atoi(argv[++i]);
} else if (ARG(pers_retry_delay_max)) {
} else if (!strncmp(argv[i], "-psn_", strlen("-psn_"))) {
// ignore -psn argument on Mac OS X
} else if (ARG(redirectio)) {
redirect_io = true;
} else if (ARG(reset_project)) {
if (i == argc-1) show_options = true;
else pers_retry_delay_max = atoi(argv[++i]);
} else if (ARG(pers_giveup)) {
else safe_strcpy(reset_project_url, argv[++i]);
} else if (ARG(retry_cap)) {
if (i == argc-1) show_options = true;
else pers_giveup = atoi(argv[++i]);
} else if (ARG(detach_phase_two)) {
detach_console = true;
// the above options are private (i.e. not shown by -help)
// Public options follow.
// NOTE: if you change or add anything, make the same chane
// in show_options() (above) and in doc/client.php
else retry_cap = atoi(argv[++i]);
} else if (ARG(run_by_updater)) {
run_by_updater = true;
} else if (ARG(run_cpu_benchmarks)) {
run_cpu_benchmarks = true;
} else if (ARG(saver)) {
started_by_screensaver = true;
} else if (ARG(sched_retry_delay_max)) {
if (i == argc-1) show_options = true;
else sched_retry_delay_max = atoi(argv[++i]);
} else if (ARG(sched_retry_delay_min)) {
if (i == argc-1) show_options = true;
else sched_retry_delay_min = atoi(argv[++i]);
} else if (ARG(show_projects)) {
show_projects = true;
} else if (ARG(detach_project)) {
if (i == argc-1) show_options = true;
else safe_strcpy(detach_project_url, argv[++i]);
} else if (ARG(reset_project)) {
} else if (ARG(skip_cpu_benchmarks)) {
skip_cpu_benchmarks = true;
} else if (ARG(start_delay)) {
if (i == argc-1) show_options = true;
else safe_strcpy(reset_project_url, argv[++i]);
else config.start_delay = atof(argv[++i]);
} else if (ARG(update_prefs)) {
if (i == argc-1) show_options = true;
else safe_strcpy(update_prefs_url, argv[++i]);
} else if (ARG(run_cpu_benchmarks)) {
run_cpu_benchmarks = true;
} else if (ARG(attach_project)) {
if (i >= argc-2) {
show_options = true;
} else {
safe_strcpy(attach_project_url, argv[++i]);
safe_strcpy(attach_project_auth, argv[++i]);
}
} else if (ARG(version)) {
printf(BOINC_VERSION_STRING " " HOSTTYPE "\n");
exit(0);
} else if (ARG(allow_remote_gui_rpc)) {
allow_remote_gui_rpc = true;
} else if (ARG(gui_rpc_port)) {
cmdline_gui_rpc_port = atoi(argv[++i]);
} else if (ARG(redirectio)) {
redirect_io = true;
} else if (ARG(help)) {
print_options(argv[0]);
exit(0);
} else if (ARG(dir)) {
if (i == argc-1) {
show_options = true;
} else {
if (chdir(argv[++i])) {
perror("chdir");
exit(1);
}
}
} else if (ARG(no_gui_rpc)) {
no_gui_rpc = true;
} else if (ARG(insecure)) {
#ifdef SANDBOX
g_use_sandbox = false;
#endif
} else if (ARG(launched_by_manager)) {
launched_by_manager = true;
} else if (ARG(run_by_updater)) {
run_by_updater = true;
} else if (ARG(start_delay)) {
if (i == argc-1) show_options = true;
else config.start_delay = atof(argv[++i]);
} else if (ARG(allow_multiple_clients)) {
config.allow_multiple_clients = true;
} else {
printf("Unknown option: %s\n", argv[i]);
show_options = true;
......
......@@ -262,7 +262,7 @@ void CLIENT_STATE::show_global_prefs_source(bool found_venue) {
);
}
if (strlen(main_host_venue)) {
msg_printf(NULL, MSG_INFO, "Computer location: %s", main_host_venue);
msg_printf(NULL, MSG_INFO, "Computer location: %s", main_host_venue);
if (found_venue) {
msg_printf(NULL, MSG_INFO,
"General prefs: using separate prefs for %s", main_host_venue
......@@ -274,7 +274,7 @@ void CLIENT_STATE::show_global_prefs_source(bool found_venue) {
);
}
} else {
msg_printf(NULL, MSG_INFO, "Host location: none");
msg_printf(NULL, MSG_INFO, "Host location: none");
msg_printf(NULL, MSG_INFO, "General prefs: using your defaults");
}
}
......@@ -335,13 +335,13 @@ int PROJECT::parse_preferences_for_user_files() {
void CLIENT_STATE::read_global_prefs() {
bool found_venue;
int retval;
FILE* f;
FILE* f;
string foo;
retval = read_file_string(GLOBAL_PREFS_OVERRIDE_FILE, foo);
if (!retval) {
parse_str(foo.c_str(), "<host_venue>", main_host_venue, sizeof(main_host_venue));
}
parse_str(foo.c_str(), "<host_venue>", main_host_venue, sizeof(main_host_venue));
}
retval = global_prefs.parse_file(
GLOBAL_PREFS_FILE_NAME, main_host_venue, found_venue
......@@ -356,18 +356,18 @@ void CLIENT_STATE::read_global_prefs() {
"Couldn't parse preferences file - using BOINC defaults"
);
boinc_delete_file(GLOBAL_PREFS_FILE_NAME);
global_prefs.init();
}
global_prefs.init();
} else {
// check that the source project's venue matches main_host_venue.
// If not, read file again.
// This is a fix for cases where main_host_venue is out of synch
//
PROJECT* p = global_prefs_source_project();
if (p && strcmp(main_host_venue, p->host_venue)) {
strcpy(main_host_venue, p->host_venue);
global_prefs.parse_file(GLOBAL_PREFS_FILE_NAME, main_host_venue, found_venue);
}
// check that the source project's venue matches main_host_venue.
// If not, read file again.
// This is a fix for cases where main_host_venue is out of synch
//
PROJECT* p = global_prefs_source_project();
if (p && strcmp(main_host_venue, p->host_venue)) {
strcpy(main_host_venue, p->host_venue);
global_prefs.parse_file(GLOBAL_PREFS_FILE_NAME, main_host_venue, found_venue);
}
show_global_prefs_source(found_venue);
}
......@@ -385,17 +385,17 @@ void CLIENT_STATE::read_global_prefs() {
}
msg_printf(NULL, MSG_INFO,
"Preferences limit memory usage when active to %.2fMB",
"Preferences limit memory usage when active to %.2fMB",
(host_info.m_nbytes*global_prefs.ram_max_used_busy_frac)/MEGA
);
msg_printf(NULL, MSG_INFO,
"Preferences limit memory usage when idle to %.2fMB",
(host_info.m_nbytes*global_prefs.ram_max_used_idle_frac)/MEGA
"Preferences limit memory usage when idle to %.2fMB",
(host_info.m_nbytes*global_prefs.ram_max_used_idle_frac)/MEGA
);
double x;
total_disk_usage(x);
msg_printf(NULL, MSG_INFO,
"Preferences limit disk usage to %.2fGB",
"Preferences limit disk usage to %.2fGB",
allowed_disk_usage(x)/GIGA
);
// max_cpus, bandwidth limits may have changed
......@@ -406,10 +406,10 @@ void CLIENT_STATE::read_global_prefs() {
"Preferences limit # CPUs to %d", ncpus
);
}
file_xfers->set_bandwidth_limits(true);
file_xfers->set_bandwidth_limits(false);
request_schedule_cpus("Prefs update");
request_work_fetch("Prefs update");
file_xfers->set_bandwidth_limits(true);
file_xfers->set_bandwidth_limits(false);
request_schedule_cpus("Prefs update");
request_work_fetch("Prefs update");
}
int CLIENT_STATE::save_global_prefs(
......@@ -447,16 +447,16 @@ double CLIENT_STATE::available_ram() {
if (user_active) {
return host_info.m_nbytes * global_prefs.ram_max_used_busy_frac;
} else {
return host_info.m_nbytes * global_prefs.ram_max_used_idle_frac;
return host_info.m_nbytes * global_prefs.ram_max_used_idle_frac;
}
}
// max amount that will ever be usable
//
double CLIENT_STATE::max_available_ram() {
return host_info.m_nbytes*std::max(
global_prefs.ram_max_used_busy_frac, global_prefs.ram_max_used_idle_frac
);
return host_info.m_nbytes*std::max(
global_prefs.ram_max_used_busy_frac, global_prefs.ram_max_used_idle_frac
);
}
const char *BOINC_RCSID_92ad99cddf = "$Id$";
......@@ -835,16 +835,17 @@ int CLIENT_STATE::handle_scheduler_reply(PROJECT* project, char* scheduler_url)
}
for (i=0; i<sr.result_abort_if_not_started.size(); i++) {
RESULT* rp = lookup_result(project, sr.result_abort_if_not_started[i].name);
if (rp) {
ACTIVE_TASK* atp = lookup_active_task_by_result(rp);
if (!atp) {
rp->abort_inactive(ERR_ABORTED_BY_PROJECT);
}
} else {
if (!rp) {
msg_printf(project, MSG_INTERNAL_ERROR,
"Server requested conditional abort of unknown task %s",
sr.result_abort_if_not_started[i].name
);
continue;
}
if (rp->computing_done()) continue;
ACTIVE_TASK* atp = lookup_active_task_by_result(rp);
if (!atp) {
rp->abort_inactive(ERR_ABORTED_BY_PROJECT);
}
}
......
......@@ -31,6 +31,7 @@
#include "error_numbers.h"
#include "common_defs.h"
#include "file_names.h"
#include "client_state.h"
#include "client_msgs.h"
#include "parse.h"
#include "str_util.h"
......@@ -194,7 +195,7 @@ void CONFIG::defaults() {
int CONFIG::parse_options(XML_PARSER& xp) {
char tag[1024], path[256];
bool is_tag;
bool is_tag, btemp;
string s;
while (!xp.get(tag, sizeof(tag), is_tag)) {
......@@ -259,6 +260,10 @@ int CONFIG::parse_options(XML_PARSER& xp) {
continue;
}
if (xp.parse_bool(tag, "no_gpus", no_gpus)) continue;
if (xp.parse_bool(tag, "abort_jobs_on_exit", btemp)) {
gstate.abort_jobs_on_exit = true;
continue;
}
msg_printf(NULL, MSG_USER_ERROR, "Unrecognized tag in %s: <%s>\n",
CONFIG_FILE, tag
);
......
......@@ -188,8 +188,7 @@ DWORD WINAPI Win9xMonitorSystemThread( LPVOID ) {
wc.lpszMenuName = NULL;
wc.lpszClassName = "BOINCWin9xMonitorSystem";
if (!RegisterClass(&wc))
{
if (!RegisterClass(&wc)) {
fprintf(stderr, "Failed to register the Win9xMonitorSystem window class.\n");
return 1;
}
......@@ -208,14 +207,12 @@ DWORD WINAPI Win9xMonitorSystemThread( LPVOID ) {
NULL,
NULL);
if (!hwndMain)
{
if (!hwndMain) {
fprintf(stderr, "Failed to create the Win9xMonitorSystem window.\n");
return 0;
}
while (GetMessage(&msg, NULL, 0, 0))
{
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
......@@ -389,18 +386,20 @@ int initialize() {
// Initialize WinSock
#if defined(_WIN32) && defined(USE_WINSOCK)
if ( WinsockInitialize() != 0 ) {
if (WinsockInitialize() != 0) {
if (!gstate.executing_as_daemon) {
fprintf(stderr,
TEXT("BOINC Core Client Error Message\n"
"Failed to initialize the Windows Sockets interface\n"
"Terminating Application...\n")
"Failed to initialize the Windows Sockets interface\n"
"Terminating Application...\n"
)