attempt to work around for bug #274
git-svn-id: https://svn.musicpd.org/mpd/trunk@1847 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
5f4f491fb1
commit
25c923809a
@ -69,6 +69,9 @@ size_t inputStream_fileRead(InputStream * inStream, void * ptr, size_t size,
|
|||||||
size_t readSize;
|
size_t readSize;
|
||||||
|
|
||||||
readSize = fread(ptr,size,nmemb,(FILE *)inStream->data);
|
readSize = fread(ptr,size,nmemb,(FILE *)inStream->data);
|
||||||
|
if(readSize <=0 && ferror((FILE *)inStream->data)) {
|
||||||
|
inStream->error = errno;
|
||||||
|
}
|
||||||
|
|
||||||
inStream->offset = ftell((FILE *)inStream->data);
|
inStream->offset = ftell((FILE *)inStream->data);
|
||||||
|
|
||||||
@ -85,10 +88,15 @@ int inputStream_fileClose(InputStream * inStream) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int inputStream_fileAtEOF(InputStream * inStream) {
|
int inputStream_fileAtEOF(InputStream * inStream) {
|
||||||
return feof((FILE *)inStream->data);
|
if(feof((FILE *)inStream->data)) return 1;
|
||||||
|
|
||||||
|
if(ferror((FILE *)inStream->data) && inStream->error != EINTR) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int inputStream_fileBuffer(InputStream * inStream) {
|
int inputStream_fileBuffer(InputStream * inStream) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* vim:set shiftwidth=4 tabstop=8 expandtab: */
|
|
||||||
|
Loading…
Reference in New Issue
Block a user