added security to fd management, corrected bug causing bad fseeks

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2651 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-03-28 10:03:44 +00:00
parent dc8978b401
commit 9abbe935b3
2 changed files with 3 additions and 1 deletions

View File

@ -431,6 +431,7 @@ bool ftExtraList::loadList(std::list<RsItem *> load)
}
fclose(fd);
fd = NULL ;
if (ts > (time_t)fi->file.age)
{

View File

@ -25,6 +25,7 @@ ftFileProvider::~ftFileProvider(){
#endif
if (fd!=NULL) {
fclose(fd);
fd = NULL ;
}
}
@ -239,7 +240,7 @@ int ftFileProvider::initializeFileAttrs()
* attempt to open file
*/
fd = fopen64(file_name.c_str(), "rb");
fd = fopen64(file_name.c_str(), "r+b");
if (!fd)
{
std::cerr << "ftFileProvider::initializeFileAttrs() Failed to open (r+b): ";