mirror of https://github.com/BOINC/boinc.git
- client: fix bug in writing daily xfer history file
svn path=/trunk/boinc/; revision=24341
This commit is contained in:
parent
115ca46730
commit
56492aaeac
|
@ -6863,7 +6863,7 @@ David 5 Oct
|
|||
client/
|
||||
pers_file_xfer.cpp
|
||||
|
||||
David 5 Oct
|
||||
David 6 Oct
|
||||
- GUI RPC: add get_daily_xfer_history() RPC for getting
|
||||
the daily records of #bytes uploaded and downloaded
|
||||
|
||||
|
@ -6876,3 +6876,10 @@ David 5 Oct
|
|||
gui_rpc_server_ops.cpp
|
||||
net_stats.cpp,h
|
||||
main.cpp
|
||||
|
||||
David 6 Oct
|
||||
- client: fix bug in writing daily xfer history file
|
||||
|
||||
client/
|
||||
main.cpp
|
||||
net_stats.cpp
|
||||
|
|
|
@ -280,7 +280,7 @@ static int finalize() {
|
|||
|
||||
#ifdef USE_WINSOCK
|
||||
if (WinsockCleanup()) {
|
||||
log_message_error("Failed to cleanup the Windows Sockets interface");
|
||||
log_message_error("WinSockCleanup() failed");
|
||||
return ERR_IO;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -378,7 +378,7 @@ int DAILY_XFER_HISTORY::write_xml(MIOFILE& out) {
|
|||
dx.write(out);
|
||||
}
|
||||
int n = out.printf("</daily_xfers>\n");
|
||||
if (n != 1) return ERR_FWRITE;
|
||||
if (n <= 0) return ERR_FWRITE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -389,11 +389,21 @@ void DAILY_XFER_HISTORY::write_file() {
|
|||
mf.init_file(f);
|
||||
int retval = write_xml(mf);
|
||||
fclose(f);
|
||||
if (!retval) {
|
||||
retval = boinc_rename(TEMP_FILE_NAME, DAILY_XFER_HISTORY_FILENAME);
|
||||
if (!retval) {
|
||||
dirty = false;
|
||||
}
|
||||
if (retval) {
|
||||
msg_printf(0, MSG_INTERNAL_ERROR,
|
||||
"failed to write xfer history: %s",
|
||||
boincerror(retval)
|
||||
);
|
||||
return;
|
||||
}
|
||||
retval = boinc_rename(TEMP_FILE_NAME, DAILY_XFER_HISTORY_FILENAME);
|
||||
if (retval) {
|
||||
msg_printf(0, MSG_INTERNAL_ERROR,
|
||||
"failed to rename xfer history file: %s",
|
||||
boincerror(retval)
|
||||
);
|
||||
} else {
|
||||
dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue