Changeset: f2f596b87728 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f2f596b87728
Modified Files:
gdk/gdk_posix.c
Branch: Feb2013
Log Message:
When shrinking memory map, also truncate file.
diffs (15 lines):
diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -411,7 +411,10 @@ MT_mremap(const char *path, int mode, vo
if (new_size < old_size) {
/* shrink */
- munmap((char *) old_address + new_size, old_size - new_size);
+ if (munmap((char *) old_address + new_size,
+ old_size - new_size) < 0)
+ return NULL;
+ truncate(path, (off_t) new_size);
#ifdef MMAP_DEBUG
fprintf(stderr, "MT_mremap(%s,"PTRFMT","SZFMT","SZFMT") ->
shrinking\n", path?path:"NULL", PTRFMTCAST old_address, old_size, new_size);
#endif
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list