src/platform_posix.c
changeset 1335 1b9a72908ece
parent 1327 998351d485d9
child 1402 c5a5dadb901d
equal deleted inserted replaced
1334:8214ccf21d36 1335:1b9a72908ece
   277 
   277 
   278 
   278 
   279 int __PHYSFS_platformFlush(void *opaque)
   279 int __PHYSFS_platformFlush(void *opaque)
   280 {
   280 {
   281     const int fd = *((int *) opaque);
   281     const int fd = *((int *) opaque);
   282     BAIL_IF_MACRO(fsync(fd) == -1, errcodeFromErrno(), 0);
   282     if ((fcntl(fd, F_GETFL) & O_ACCMODE) != O_RDONLY)
       
   283         BAIL_IF_MACRO(fsync(fd) == -1, errcodeFromErrno(), 0);
   283     return 1;
   284     return 1;
   284 } /* __PHYSFS_platformFlush */
   285 } /* __PHYSFS_platformFlush */
   285 
   286 
   286 
   287 
   287 void __PHYSFS_platformClose(void *opaque)
   288 void __PHYSFS_platformClose(void *opaque)