Backport to stable-2.0: don't fsync read-only files.
This commit is contained in:
parent
038b0fa5fa
commit
87f4ed6786
|
@ -109,6 +109,9 @@ Bug fixes:
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
Lauri Kasanen
|
Lauri Kasanen
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
Andreas Karlsson
|
||||||
|
|
||||||
Other stuff:
|
Other stuff:
|
||||||
Your name here! Patches go to icculus@icculus.org ...
|
Your name here! Patches go to icculus@icculus.org ...
|
||||||
|
|
||||||
|
|
|
@ -390,6 +390,7 @@ int __PHYSFS_platformEOF(void *opaque)
|
||||||
int __PHYSFS_platformFlush(void *opaque)
|
int __PHYSFS_platformFlush(void *opaque)
|
||||||
{
|
{
|
||||||
int fd = *((int *) opaque);
|
int fd = *((int *) opaque);
|
||||||
|
if ((fcntl(fd, F_GETFL) & O_ACCMODE) != O_RDONLY)
|
||||||
BAIL_IF_MACRO(fsync(fd) == -1, strerror(errno), 0);
|
BAIL_IF_MACRO(fsync(fd) == -1, strerror(errno), 0);
|
||||||
return(1);
|
return(1);
|
||||||
} /* __PHYSFS_platformFlush */
|
} /* __PHYSFS_platformFlush */
|
||||||
|
|
Loading…
Reference in New Issue