projects
/
platform
/
upstream
/
orc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ecb27cc
)
codemem: check ftruncate() return value
author
David Schleef
<ds@schleef.org>
Mon, 25 Apr 2011 22:09:35 +0000
(15:09 -0700)
committer
David Schleef
<ds@schleef.org>
Mon, 25 Apr 2011 22:09:35 +0000
(15:09 -0700)
orc/orccodemem.c
patch
|
blob
|
history
diff --git
a/orc/orccodemem.c
b/orc/orccodemem.c
index
96fc3a4
..
1760ec4
100644
(file)
--- a/
orc/orccodemem.c
+++ b/
orc/orccodemem.c
@@
-210,6
+210,11
@@
orc_code_region_allocate_codemem_dual_map (OrcCodeRegion *region,
free (filename);
n = ftruncate (fd, SIZE);
+ if (n < 0) {
+ ORC_WARNING("failed to expand file to size");
+ close (fd);
+ return FALSE;
+ }
region->exec_ptr = mmap (NULL, SIZE, PROT_READ|PROT_EXEC,
MAP_SHARED, fd, 0);