@@ -1126,22 +1126,33 @@
int RtmpOSFileRead(RTMP_OS_FD osfd,
char *pDataPtr, int readLen) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
/* The object must have a read method */
if (osfd->f_op && osfd->f_op->read) {
return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos);
} else {
DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n"));
+#else
+ if (osfd && osfd->f_mode & FMODE_CAN_READ) {
+ return __vfs_read(osfd, pDataPtr, readLen, &osfd->f_pos);
+ } else {
+ DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n"));
+#endif
return -1;
}
}
int RtmpOSFileWrite(RTMP_OS_FD osfd,
char *pDataPtr, int writeLen) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
return osfd->f_op->write(osfd,
pDataPtr,
(
size_t) writeLen,
&osfd->f_pos);
+#else
+ return __vfs_write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
+#endif
}
static inline void __RtmpOSFSInfoChange(OS_FS_INFO * pOSFSInfo,