Use fileno() to retrieve the fd from a FILE structure (fixes #958)

This commit is contained in:
Frank Schmirler
2012-05-03 08:30:32 +02:00
parent 8719007f5a
commit 316ac3344d
2 changed files with 3 additions and 1 deletions

View File

@@ -200,7 +200,7 @@ unsigned long RecPlayer::getBlock(unsigned char* buffer, uint64_t position, unsi
if (fread(&buffer[got], getFromThisSegment, 1, file) != 1) return 0; // umm, big problem.
// Tell linux not to bother keeping the data in the FS cache
posix_fadvise(file->_fileno, filePosition, getFromThisSegment, POSIX_FADV_DONTNEED);
posix_fadvise(fileno(file), filePosition, getFromThisSegment, POSIX_FADV_DONTNEED);
got += getFromThisSegment;
currentPosition += getFromThisSegment;