added check for return value of fseek in ftFileProvider

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8510 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-06-17 09:36:20 +00:00
parent 15bb95a398
commit cc0f1be95d

View File

@ -175,7 +175,14 @@ bool ftFileProvider::getFileData(const RsPeerId& peer_id,uint64_t offset, uint32
/*
* seek for base_loc
*/
fseeko64(fd, base_loc, SEEK_SET);
if(fseeko64(fd, base_loc, SEEK_SET) == -1)
{
#ifdef DEBUG_FT_FILE_PROVIDER
std::cerr << "ftFileProvider::getFileData() Failed to seek. Data_size=" << data_size << ", base_loc=" << base_loc << " !" << std::endl;
#endif
//free(data); No!! It's already freed upwards in ftDataMultiplex::locked_handleServerRequest()
return 0;
}
// Data space allocated by caller.
//void *data = malloc(chunk_size);