Ticket #9268: io.diff
File io.diff, 2.4 KB (added by , 13 years ago) |
---|
-
mythtv/libs/libmythtv/mythiowrapper.cpp
96 96 return -1; 97 97 98 98 if (S_ISDIR( fileinfo.st_mode )) // libmythdvdnav tries to open() a dir 99 return -1;99 return errno = EISDIR, -1; 100 100 101 101 int fileID = -1; 102 102 if (strncmp(pathname, "myth://", 7)) … … 191 191 return result; 192 192 } 193 193 194 #ifdef USING_MINGW 195 # undef lseek 196 # define lseek _lseeki64 197 # undef off_t 198 # define off_t off64_t 199 #endif 194 200 off_t mythfile_seek(int fileID, off_t offset, int whence) 195 201 { 196 202 off_t result = -1; … … 204 210 else if (m_remotefiles.contains(fileID)) 205 211 result = m_remotefiles[fileID]->Seek(offset, whence); 206 212 else if (m_localfiles.contains(fileID)) 207 #ifdef USING_MINGW208 result = lseek64(m_localfiles[fileID], offset, whence);209 #else210 213 result = lseek(m_localfiles[fileID], offset, whence); 211 #endif212 214 m_fileWrapperLock.unlock(); 213 215 214 216 return result; … … 226 228 else if (m_remotefiles.contains(fileID)) 227 229 result = m_remotefiles[fileID]->Seek(0, SEEK_CUR); 228 230 else if (m_localfiles.contains(fileID)) 229 #ifdef USING_MINGW230 result = lseek64(m_localfiles[fileID], 0, SEEK_CUR);231 #else232 231 result = lseek(m_localfiles[fileID], 0, SEEK_CUR); 233 #endif234 232 m_fileWrapperLock.unlock(); 235 233 236 234 return result; 237 235 } 236 #ifdef USING_MINGW 237 # undef lseek 238 # undef off_t 239 #endif 238 240 239 241 ssize_t mythfile_read(int fileID, void *buf, size_t count) 240 242 { -
mythtv/libs/libmythtv/mythiowrapper.h
11 11 int mythfile_check(int fileID); 12 12 int mythfile_open(const char *pathname, int flags); 13 13 int mythfile_close(int fileID); 14 #ifdef USING_MINGW 15 off64_t mythfile_seek(int fileID, off64_t offset, int whence); 16 off64_t mythfile_tell(int fileID); 17 #else 14 18 off_t mythfile_seek(int fileID, off_t offset, int whence); 15 19 off_t mythfile_tell(int fileID); 20 #endif 16 21 ssize_t mythfile_read(int fileID, void *buf, size_t count); 17 22 ssize_t mythfile_write(int fileID, void *buf, size_t count); 18 23 int mythfile_stat(const char *path, struct stat *buf);