diff --git a/client/app.C b/client/app.C index cc9b10983e..d3649710da 100644 --- a/client/app.C +++ b/client/app.C @@ -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) { diff --git a/client/client_state.C b/client/client_state.C index 5b9008ac4a..be71667ea6 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -1190,7 +1190,7 @@ bool CLIENT_STATE::garbage_collect() { for (i=0; iapp_files.size(); j++) { - avp->app_files[i].file_info->ref_cnt++; + avp->app_files[j].file_info->ref_cnt++; } } diff --git a/client/cs_apps.C b/client/cs_apps.C index 18e31e0279..2ec3e84082 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -135,7 +135,7 @@ bool CLIENT_STATE::handle_running_apps() { for (i=0; istate != 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; diff --git a/client/pers_file_xfer.C b/client/pers_file_xfer.C index c6af8b0178..0905197609 100644 --- a/client/pers_file_xfer.C +++ b/client/pers_file_xfer.C @@ -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)) continue; else if (parse_double(buf, "", 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; }