Ported branch commit 3017:

- added failure tests for fwrite. Some where missing.
	- added a test against the IP 1.0.0.0, which pops up on MacOS (when the peer is not connected to the internet?)
	- put some additional debug messages.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3018 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-05-28 14:00:35 +00:00
parent c366c5cc93
commit a3a75b7aea
4 changed files with 26 additions and 8 deletions

View file

@ -273,8 +273,12 @@ bool p3ConfigMgr::backedUpFileSave(const std::string& fname, const std::string&
return true;
}
fwrite(config_buff,1, size_file, file);
fwrite(sign_buff, 1, size_sign, sign);
if(size_file != fwrite(config_buff,1, size_file, file))
getPqiNotify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing backup configuration file " + fname_backup + "\nIs your disc full or out of quota ?");
if(size_sign != fwrite(sign_buff, 1, size_sign, sign))
getPqiNotify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing main signature file " + sign_fname_backup + "\nIs your disc full or out of quota ?");
fclose(file);
fclose(sign);
@ -751,7 +755,8 @@ bool p3Config::backedUpFileSave(const std::string& cfg_fname, const std::string&
written &= false; // at least one file save should be successful
}
if(size_file > 0){
if(size_file > 0)
{
// now write actual back-up file
cfg_file = fopen(cfg_fname_backup.c_str(), "wb");
@ -762,7 +767,9 @@ bool p3Config::backedUpFileSave(const std::string& cfg_fname, const std::string&
#endif
}
fwrite(buff, 1, size_file, cfg_file);
if(size_file != fwrite(buff, 1, size_file, cfg_file))
getPqiNotify()->AddSysMessage(0, RS_SYS_WARNING, "Write error", "Error while writing backup configuration file " + cfg_fname_backup + "\nIs your disc full or out of quota ?");
fclose(cfg_file);
#ifdef CONFIG_DEBUG