*** empty log message ***

svn path=/trunk/boinc/; revision=9975
This commit is contained in:
Rom Walton 2006-04-19 23:28:08 +00:00
parent 6d367a4317
commit fe570894fc
5 changed files with 49 additions and 4 deletions

View File

@ -246,12 +246,21 @@ static bool update_app_progress(
// the following 2 functions are used for apps without graphics
//
int boinc_init() {
int retval;
if (!is_diagnostics_initialized()) {
retval = boinc_init_diagnostics(BOINC_DIAG_USEDEFULATS);
if (retval) return retval;
}
boinc_options_defaults(options);
return boinc_init_options(&options);
}
int boinc_init_options(BOINC_OPTIONS* opt) {
int retval;
if (!is_diagnostics_initialized()) {
retval = boinc_init_diagnostics(BOINC_DIAG_USEDEFULATS);
if (retval) return retval;
}
retval = boinc_init_options_general(*opt);
if (retval) return retval;
return set_worker_timer();

View File

@ -23,6 +23,7 @@
#include "config.h"
#endif
#include "diagnostics.h"
#include "boinc_api.h"
#include "graphics_impl.h"
#include "graphics_api.h"
@ -41,6 +42,11 @@ static void init_main_state() {
}
int boinc_init_graphics(void (*worker)()) {
int retval;
if (!is_diagnostics_initialized()) {
retval = boinc_init_diagnostics(BOINC_DIAG_USEDEFULATS);
if (retval) return retval;
}
init_main_state();
return boinc_init_graphics_impl(worker, &boinc_main_state);
}

View File

@ -4060,7 +4060,6 @@ David 19 Apr 2006
sched/
server_types.C
Walt 19 Apr 2006
- Code cleanup: remove duplicate calls to xml_unescape.
- Bug Fix: Change HTTP redirect limit to 50
@ -4072,7 +4071,17 @@ Walt 19 Apr 2006
until the connection attempt completes or times out.
client/
http_curl.C
http_curl.C
lib/
proxy_info.C
Rom 19 Apr 2006
- If an application hasn't initialized the diagnostics system, provide
reasonable defaults and initialize it for them. This only handles
the boinc_init() and boinc_init_graphics() cases.
api/
boinc_api.C
graphics_api.C
lib/
diagnostics.C, .h

View File

@ -61,6 +61,7 @@
#define MAX_STDOUT_FILE_SIZE 2048*1024
static int diagnostics_initialized = false;
static int flags;
static char stdout_log[256];
static char stdout_archive[256];
@ -98,6 +99,13 @@ static void boinc_catch_signal(int signal);
#endif
// has the diagnostics library been initialized?.
//
int is_diagnostics_initialized(){
return diagnostics_initialized;
}
// stub function for initializing the diagnostics environment.
//
int boinc_init_diagnostics(int _flags) {
@ -140,7 +148,6 @@ int boinc_install_signal_handlers() {
int diagnostics_init(
int _flags, const char* stdout_prefix, const char* stderr_prefix
) {
flags = _flags;
snprintf(stdout_log, sizeof(stdout_log), "%s.txt", stdout_prefix);
snprintf(stdout_archive, sizeof(stdout_archive), "%s.old", stdout_prefix);
@ -260,7 +267,10 @@ int diagnostics_init(
if (match_tag(buf, "</app_init_data>")) break;
else if (parse_str(buf, "<boinc_dir>", boinc_dir, 256)) continue;
else if (parse_str(buf, "<project_symstore>", symstore, 256)) continue;
else if (match_tag(buf, "<use_http_proxy/>")) boinc_proxy_enabled = true;
else if (match_tag(buf, "<use_http_proxy/>")) {
boinc_proxy_enabled = true;
continue;
}
else if (parse_str(buf, "<http_server_name>", proxy_address, 256)) continue;
else if (parse_int(buf, "<http_server_port>", proxy_port)) continue;
}
@ -274,6 +284,11 @@ int diagnostics_init(
}
}
// We have completed initializing the diagnostics system.
diagnostics_initialized = true;
return BOINC_SUCCESS;
}

View File

@ -53,6 +53,11 @@
#define BOINC_DIAG_TRACETOSTDOUT 0x00000400L
#define BOINC_DIAG_HEAPCHECKEVERYALLOC 0x00000800L
#define BOINC_DIAG_BOINCAPPLICATION 0x00001000L
#define BOINC_DIAG_USEDEFULATS BOINC_DIAG_DUMPCALLSTACKENABLED | \
BOINC_DIAG_HEAPCHECKENABLED | \
BOINC_DIAG_MEMORYLEAKCHECKENABLED | \
BOINC_DIAG_REDIRECTSTDERR | \
BOINC_DIAG_TRACETOSTDERR
// thread types used for dumping backtraces
@ -73,6 +78,7 @@ extern "C" {
#endif
// These are functions common to all platforms
extern int is_diagnostics_initialized();
extern int boinc_init_diagnostics(int flags);
extern int boinc_finish_diag();
extern int boinc_install_signal_handlers();