summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/dba/dba_flatfile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c
index fa1232779a..1cd82712f6 100644
--- a/ext/dba/dba_flatfile.c
+++ b/ext/dba/dba_flatfile.c
@@ -48,8 +48,13 @@ DBA_OPEN_FUNC(flatfile)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream");
return FAILURE;
}
+#ifdef F_SETFL
+ /* Needed becasue some systems do not allow to write to the original
+ * file contents with O_APPEND being set.
+ */
flags = fcntl(fd, F_SETFL);
fcntl(fd, F_SETFL, flags & ~O_APPEND);
+#endif
}
info->dbf = pemalloc(sizeof(flatfile), info->flags&DBA_PERSISTENT);