show_message, bug fix

svn path=/trunk/boinc/; revision=1116
This commit is contained in:
Eric Heien 2003-03-29 07:25:48 +00:00
parent 72b6e7a74f
commit 3c84382336
4 changed files with 24 additions and 24 deletions

View File

@ -163,7 +163,7 @@ int ACTIVE_TASK::start(bool first_time) {
f = fopen(init_data_path, "w");
if (!f) {
sprintf(
buf, "Failed to open core-to-app prefs file %s.\n",
buf, "Failed to open core-to-app prefs file %s",
init_data_path
);
show_message(wup->project, buf, MSG_ERROR);
@ -181,7 +181,7 @@ int ACTIVE_TASK::start(bool first_time) {
f = fopen(graphics_data_path, "w");
if (!f) {
sprintf(
buf, "Failed to open core-to-app graphics prefs file %s.\n",
buf, "Failed to open core-to-app graphics prefs file %s",
graphics_data_path
);
show_message(wup->project, buf, MSG_ERROR);
@ -193,7 +193,7 @@ int ACTIVE_TASK::start(bool first_time) {
sprintf(fd_init_path, "%s%s%s", slot_dir, PATH_SEPARATOR, FD_INIT_FILE);
f = fopen(fd_init_path, "w");
if (!f) {
sprintf(buf, "Failed to open init file %s.\n", fd_init_path);
sprintf(buf, "Failed to open init file %s", fd_init_path);
show_message(wup->project, buf, MSG_ERROR);
return ERR_FOPEN;
}
@ -215,7 +215,7 @@ int ACTIVE_TASK::start(bool first_time) {
printf("link %s to %s\n", file_path, link_path);
}
if (retval) {
sprintf(buf, "Can't link %s to %s\n", file_path, link_path);
sprintf(buf, "Can't link %s to %s", file_path, link_path);
show_message(wup->project, buf, MSG_ERROR);
fclose(f);
return retval;
@ -237,7 +237,7 @@ int ACTIVE_TASK::start(bool first_time) {
}
retval = boinc_link(buf, link_path);
if (retval) {
sprintf(buf, "Can't link %s to %s\n", file_path, link_path);
sprintf(buf, "Can't link %s to %s", file_path, link_path);
show_message(wup->project, buf, MSG_ERROR);
fclose(f);
return retval;
@ -264,7 +264,7 @@ int ACTIVE_TASK::start(bool first_time) {
}
retval = boinc_link(buf, link_path);
if (retval) {
sprintf(buf, "Can't link %s to %s\n", file_path, link_path);
sprintf(buf, "Can't link %s to %s", file_path, link_path);
show_message(wup->project, buf, MSG_ERROR);
fclose(f);
return retval;
@ -325,7 +325,7 @@ int ACTIVE_TASK::start(bool first_time) {
LocalFree(lpMsgBuf);
return -1;
}
sprintf(buf, "CreateProcess: %s\n", (LPCTSTR)lpMsgBuf);
sprintf(buf, "CreateProcess: %s", (LPCTSTR)lpMsgBuf);
show_message(wup->project, buf, MSG_ERROR);
LocalFree(lpMsgBuf);
}
@ -641,7 +641,7 @@ void ACTIVE_TASK_SET::suspend_all() {
if (atp->suspend()) {
show_message(
atp->wup->project,
"ACTIVE_TASK_SET::suspend_all(): could not suspend active_task\n",
"ACTIVE_TASK_SET::suspend_all(): could not suspend active_task",
MSG_ERROR
);
}
@ -658,7 +658,7 @@ void ACTIVE_TASK_SET::unsuspend_all() {
if (atp->unsuspend()) {
show_message(
atp->wup->project,
"ACTIVE_TASK_SET::unsuspend_all(): could not unsuspend active_task\n",
"ACTIVE_TASK_SET::unsuspend_all(): could not unsuspend active_task",
MSG_ERROR
);
}
@ -674,7 +674,7 @@ void ACTIVE_TASK_SET::request_tasks_exit() {
atp = active_tasks[i];
if(atp->request_exit()) {
show_message(atp->wup->project,
"ACTIVE_TASK_SET::exit_tasks(): could not suspend active_task\n",
"ACTIVE_TASK_SET::exit_tasks(): could not suspend active_task",
MSG_ERROR
);
}
@ -748,7 +748,7 @@ int ACTIVE_TASK_SET::restart_tasks() {
atp->result->is_active = true;
retval = atp->start(false);
if (log_flags.task) {
sprintf(buf, "restarting computation for result %s\n", atp->result->name);
sprintf(buf, "restarting computation for result %s", atp->result->name);
show_message(atp->wup->project, buf, MSG_INFO);
}
if (retval) {

View File

@ -1190,7 +1190,7 @@ bool CLIENT_STATE::garbage_collect() {
for (i=0; i<app_versions.size(); i++) {
avp = app_versions[i];
for (j=0; j<avp->app_files.size(); j++) {
avp->app_files[i].file_info->ref_cnt++;
avp->app_files[j].file_info->ref_cnt++;
}
}

View File

@ -135,7 +135,7 @@ bool CLIENT_STATE::handle_running_apps() {
for (i=0; i<active_tasks.active_tasks.size(); i++) {
atp = active_tasks.active_tasks[i];
if (atp->state != PROCESS_RUNNING) {
sprintf(buf, "computation for result %s finished\n", atp->wup->name);
sprintf(buf, "Computation for result %s finished", atp->wup->name);
show_message(atp->wup->project, buf, MSG_INFO);
if (log_flags.task_debug) {
printf(
@ -201,7 +201,7 @@ bool CLIENT_STATE::start_apps() {
//
if (rp->state == RESULT_FILES_DOWNLOADED && !rp->is_active ) {
if (log_flags.task) {
sprintf(buf, "starting computation for result %s\n", rp->name);
sprintf(buf, "Starting computation for result %s", rp->name);
show_message(rp->project, buf, MSG_INFO);
}
rp->is_active = true;

View File

@ -94,7 +94,7 @@ bool PERS_FILE_XFER::start_xfer() {
}
if (retval) {
sprintf(buf,
"couldn't start %s for %s: error %d\n",
"Couldn't start %s for %s: error %d",
(is_upload ? "upload" : "download"), fip->get_url(), retval
);
show_message(fip->project, buf, MSG_ERROR);
@ -104,7 +104,7 @@ bool PERS_FILE_XFER::start_xfer() {
fxp = file_xfer;
if (retval) {
if (log_flags.file_xfer) {
show_message(fip->project, "file_xfer insert failed\n", MSG_ERROR);
show_message(fip->project, "file_xfer insert failed", MSG_ERROR);
}
fxp->file_xfer_retval = retval;
handle_xfer_failure(time(0));
@ -113,7 +113,7 @@ bool PERS_FILE_XFER::start_xfer() {
}
if (log_flags.file_xfer) {
sprintf(buf,
"started %s of %s to %s\n",
"Started %s of %s to %s",
(is_upload ? "upload" : "download"), fip->name, fip->get_url()
);
show_message(fip->project, buf, MSG_INFO);
@ -157,7 +157,7 @@ bool PERS_FILE_XFER::poll(time_t now) {
if (log_flags.file_xfer) {
sprintf(
buf,
"file transfer done for %s; error code %d\n",
"File transfer done for %s; error code %d",
fip->get_url(), fxp->file_xfer_retval
);
show_message(fip->project, buf, MSG_INFO);
@ -180,12 +180,12 @@ bool PERS_FILE_XFER::poll(time_t now) {
get_pathname(fip, pathname);
retval = verify_downloaded_file(pathname, *fip);
if (retval) {
sprintf(buf, "checksum or signature error for %s\n", fip->name);
sprintf(buf, "Checksum or signature error for %s", fip->name);
show_message(fip->project, buf, MSG_ERROR);
fip->status = retval;
} else {
if (log_flags.file_xfer_debug) {
sprintf(buf, "MD5 checksum validated for %s\n", pathname);
sprintf(buf, "MD5 checksum validated for %s", pathname);
show_message(fip->project, buf, MSG_INFO);
}
// Set the appropriate permissions depending on whether
@ -234,7 +234,7 @@ void PERS_FILE_XFER::handle_xfer_failure(time_t cur_time) {
}
xfer_done = true;
sprintf(buf,
"Giving up on file transfer for %s: %d\n",
"Giving up on file transfer for %s: %d",
fip->name, fip->status
);
show_message(fip->project, buf, MSG_ERROR);
@ -272,7 +272,7 @@ void PERS_FILE_XFER::retry_or_backoff(time_t cur_time) {
}
if (log_flags.file_xfer_debug) {
sprintf(buf,
"Backing off %f seconds on transfer of file %s\n",
"Backing off %f seconds on transfer of file %s",
exp_backoff, fip->name
);
show_message(fip->project, buf, MSG_INFO);
@ -291,7 +291,7 @@ int PERS_FILE_XFER::parse(FILE* fin) {
else if (parse_int(buf, "<next_request_time>", next_request_time)) continue;
else if (parse_double(buf, "<time_so_far>", time_so_far)) continue;
else {
sprintf(buf2, "PERS_FILE_XFER::parse(): unrecognized: %s\n", buf);
sprintf(buf2, "PERS_FILE_XFER::parse(): unrecognized: %s", buf);
show_message(fip->project, buf2, MSG_ERROR);
}
}
@ -356,6 +356,6 @@ int PERS_FILE_XFER_SET::remove(PERS_FILE_XFER* pfx) {
}
iter++;
}
show_message(pfx->fip->project, "PERS_FILE_XFER_SET::remove(): not found\n", MSG_ERROR);
show_message(pfx->fip->project, "PERS_FILE_XFER_SET::remove(): not found", MSG_ERROR);
return 1;
}