@ -157,6 +157,7 @@ class PosixEnv : public Env {
* result = nullptr ;
* result = nullptr ;
return IOError ( fname , errno ) ;
return IOError ( fname , errno ) ;
} else if ( options . use_direct_reads & & ! options . use_mmap_writes ) {
} else if ( options . use_direct_reads & & ! options . use_mmap_writes ) {
fclose ( f ) ;
# ifdef OS_MACOSX
# ifdef OS_MACOSX
int flags = O_RDONLY ;
int flags = O_RDONLY ;
# else
# else
@ -215,6 +216,7 @@ class PosixEnv : public Env {
}
}
close ( fd ) ;
close ( fd ) ;
} else if ( options . use_direct_reads ) {
} else if ( options . use_direct_reads ) {
close ( fd ) ;
# ifdef OS_MACOSX
# ifdef OS_MACOSX
int flags = O_RDONLY ;
int flags = O_RDONLY ;
# else
# else
@ -269,6 +271,7 @@ class PosixEnv : public Env {
if ( options . use_mmap_writes & & ! forceMmapOff ) {
if ( options . use_mmap_writes & & ! forceMmapOff ) {
result - > reset ( new PosixMmapFile ( fname , fd , page_size_ , options ) ) ;
result - > reset ( new PosixMmapFile ( fname , fd , page_size_ , options ) ) ;
} else if ( options . use_direct_writes ) {
} else if ( options . use_direct_writes ) {
close ( fd ) ;
# ifdef OS_MACOSX
# ifdef OS_MACOSX
int flags = O_WRONLY | O_APPEND | O_TRUNC | O_CREAT ;
int flags = O_WRONLY | O_APPEND | O_TRUNC | O_CREAT ;
# else
# else