Don't truncate the file to the page aligned size.
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 15 Jan 2015 23:22:09 +0000 (15:22 -0800)
committerVlad Brezae <brezaevlad@gmail.com>
Thu, 15 Jan 2015 23:27:50 +0000 (15:27 -0800)
The second open attempt at opening would fail due to the capacity being smaller than the file size.

mono/metadata/file-mmap-posix.c

index 32f555ae7b5a9832ef88622ebf225f5c47c97c10..c7836c7e66e3de4dddeeb994739e74f0e983b852 100644 (file)
@@ -280,8 +280,6 @@ open_file_map (MonoString *path, int input_fd, int mode, gint64 *capacity, int a
                goto done;
        }
 
-       *capacity = align_up_to_page_size ((size_t)*capacity);
-
        if (*capacity > buf.st_size) {
                int unused G_GNUC_UNUSED = ftruncate (fd, (off_t)*capacity);
        }