summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/memory_chunk.h3
-rw-r--r--src/storage/chewing_large_table.h1
2 files changed, 2 insertions, 2 deletions
diff --git a/src/include/memory_chunk.h b/src/include/memory_chunk.h
index da5c7d1..7b315af 100644
--- a/src/include/memory_chunk.h
+++ b/src/include/memory_chunk.h
@@ -28,7 +28,6 @@
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
-#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_MMAP
#include <sys/mman.h>
@@ -393,7 +392,7 @@ public:
*
*/
bool save(const char * filename){
- int fd = open(filename, O_WRONLY|O_CREAT, 0644);
+ int fd = open(filename, O_CREAT|O_WRONLY|O_TRUNC, 0644);
if ( -1 == fd )
return false;
diff --git a/src/storage/chewing_large_table.h b/src/storage/chewing_large_table.h
index 59f494e..6ec218f 100644
--- a/src/storage/chewing_large_table.h
+++ b/src/storage/chewing_large_table.h
@@ -23,6 +23,7 @@
#define CHEWING_LARGE_TABLE_H
+#include <stdio.h>
#include "novel_types.h"
#include "memory_chunk.h"
#include "chewing_key.h"