projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0981211
)
Fix truncation of newly created map files.
author
Vlad Brezae
<brezaevlad@gmail.com>
Thu, 15 Jan 2015 01:56:25 +0000
(17:56 -0800)
committer
Vlad Brezae
<brezaevlad@gmail.com>
Mon, 26 Jan 2015 23:06:53 +0000
(15:06 -0800)
File truncation could skip due to the fact that st_size field is only initialized for already existing files.
mono/metadata/file-mmap-posix.c
patch
|
blob
|
history
diff --git
a/mono/metadata/file-mmap-posix.c
b/mono/metadata/file-mmap-posix.c
index c7836c7e66e3de4dddeeb994739e74f0e983b852..be9f740b8572df63433e40064e5a804896784f28 100644
(file)
--- a/
mono/metadata/file-mmap-posix.c
+++ b/
mono/metadata/file-mmap-posix.c
@@
-280,7
+280,7
@@
open_file_map (MonoString *path, int input_fd, int mode, gint64 *capacity, int a
goto done;
}
- if (*capacity > buf.st_size) {
+ if (
result != 0 ||
*capacity > buf.st_size) {
int unused G_GNUC_UNUSED = ftruncate (fd, (off_t)*capacity);
}