fixes typo
authorPeng Wu <alexepico@gmail.com>
Tue, 5 Feb 2013 03:41:37 +0000 (11:41 +0800)
committerPeng Wu <alexepico@gmail.com>
Tue, 5 Feb 2013 03:41:37 +0000 (11:41 +0800)
src/include/memory_chunk.h
src/storage/chewing_large_table.h

index da5c7d1..7b315af 100644 (file)
@@ -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;
 
index 59f494e..6ec218f 100644 (file)
@@ -23,6 +23,7 @@
 #define CHEWING_LARGE_TABLE_H
 
 
+#include <stdio.h>
 #include "novel_types.h"
 #include "memory_chunk.h"
 #include "chewing_key.h"