mirror of https://github.com/BOINC/boinc.git
windows error reporting fixes
svn path=/trunk/boinc/; revision=648
This commit is contained in:
parent
f5789f4104
commit
a6d0366f59
34
client/app.C
34
client/app.C
|
@ -385,8 +385,6 @@ int ACTIVE_TASK_SET::insert(ACTIVE_TASK* atp) {
|
||||||
//
|
//
|
||||||
bool ACTIVE_TASK_SET::poll() {
|
bool ACTIVE_TASK_SET::poll() {
|
||||||
ACTIVE_TASK* atp;
|
ACTIVE_TASK* atp;
|
||||||
char path[256];
|
|
||||||
int n;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
unsigned long exit_code;
|
unsigned long exit_code;
|
||||||
|
@ -417,11 +415,13 @@ bool ACTIVE_TASK_SET::poll() {
|
||||||
atp->result->exit_status = atp->exit_status;
|
atp->result->exit_status = atp->exit_status;
|
||||||
CloseHandle(atp->pid_handle);
|
CloseHandle(atp->pid_handle);
|
||||||
CloseHandle(atp->thread_handle);
|
CloseHandle(atp->thread_handle);
|
||||||
|
atp->read_stderr_file();
|
||||||
|
clean_out_dir(atp->slot_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SYS_RESOURCE_H
|
#if HAVE_SYS_RESOURCE_H
|
||||||
|
@ -459,21 +459,29 @@ bool ACTIVE_TASK_SET::poll() {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// check for the stderr file, copy to result record
|
atp->read_stderr_file();
|
||||||
//
|
|
||||||
sprintf(path, "%s%s%s", atp->slot_dir, PATH_SEPARATOR, STDERR_FILE);
|
|
||||||
FILE* f = fopen(path, "r");
|
|
||||||
if (f) {
|
|
||||||
n = fread(atp->result->stderr_out, 1, STDERR_MAX_LEN, f);
|
|
||||||
atp->result->stderr_out[STDERR_MAX_LEN-1] = 0;
|
|
||||||
fclose(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
clean_out_dir(atp->slot_dir);
|
clean_out_dir(atp->slot_dir);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for the stderr file, copy to result record
|
||||||
|
//
|
||||||
|
bool ACTIVE_TASK::read_stderr_file() {
|
||||||
|
char path[256];
|
||||||
|
int n;
|
||||||
|
|
||||||
|
sprintf(path, "%s%s%s", slot_dir, PATH_SEPARATOR, STDERR_FILE);
|
||||||
|
FILE* f = fopen(path, "r");
|
||||||
|
if (f) {
|
||||||
|
n = fread(result->stderr_out, 1, STDERR_MAX_LEN, f);
|
||||||
|
result->stderr_out[n] = 0;
|
||||||
|
fclose(f);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Find the ACTIVE_TASK in the current set with the matching PID
|
// Find the ACTIVE_TASK in the current set with the matching PID
|
||||||
//
|
//
|
||||||
ACTIVE_TASK* ACTIVE_TASK_SET::lookup_pid(int pid) {
|
ACTIVE_TASK* ACTIVE_TASK_SET::lookup_pid(int pid) {
|
||||||
|
|
|
@ -76,6 +76,7 @@ public:
|
||||||
|
|
||||||
bool check_app_status_files();
|
bool check_app_status_files();
|
||||||
double est_time_to_completion();
|
double est_time_to_completion();
|
||||||
|
bool read_stderr_file();
|
||||||
|
|
||||||
int write(FILE*);
|
int write(FILE*);
|
||||||
int parse(FILE*, CLIENT_STATE*);
|
int parse(FILE*, CLIENT_STATE*);
|
||||||
|
|
|
@ -739,7 +739,8 @@ bool CLIENT_STATE::garbage_collect() {
|
||||||
// any errors (MD5, RSA, etc)
|
// any errors (MD5, RSA, etc)
|
||||||
fail_num = rp->wup->had_failure();
|
fail_num = rp->wup->had_failure();
|
||||||
if (fail_num) {
|
if (fail_num) {
|
||||||
rp->exit_status = fail_num;
|
if (!rp->exit_status) // If we don't already have an error for this file
|
||||||
|
rp->exit_status = fail_num;
|
||||||
if (rp->state < RESULT_READY_TO_ACK) {
|
if (rp->state < RESULT_READY_TO_ACK) {
|
||||||
rp->state = RESULT_READY_TO_ACK;
|
rp->state = RESULT_READY_TO_ACK;
|
||||||
}
|
}
|
||||||
|
@ -754,7 +755,8 @@ bool CLIENT_STATE::garbage_collect() {
|
||||||
//
|
//
|
||||||
fail_num = rp->output_files[i].file_info->had_failure();
|
fail_num = rp->output_files[i].file_info->had_failure();
|
||||||
if (fail_num) {
|
if (fail_num) {
|
||||||
rp->exit_status = fail_num;
|
if (!rp->exit_status) // If we don't already have an error for this file
|
||||||
|
rp->exit_status = fail_num;
|
||||||
if (rp->state < RESULT_READY_TO_ACK) {
|
if (rp->state < RESULT_READY_TO_ACK) {
|
||||||
rp->state = RESULT_READY_TO_ACK;
|
rp->state = RESULT_READY_TO_ACK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue