summaryrefslogtreecommitdiffhomepage
path: root/src/helper
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/mdso_map_input.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/helper/mdso_map_input.c b/src/helper/mdso_map_input.c
index 77401f3..090de12 100644
--- a/src/helper/mdso_map_input.c
+++ b/src/helper/mdso_map_input.c
@@ -41,9 +41,11 @@ int mdso_map_input(
if (ret < 0)
return MDSO_SYSTEM_ERROR(dctx);
- else if (st.st_size == 0)
- return MDSO_CUSTOM_ERROR(
- dctx,MDSO_ERR_SOURCE_SIZE_ZERO);
+ if (st.st_size == 0) {
+ map->size = 0;
+ map->addr = 0;
+ return 0;
+ }
map->size = st.st_size;
map->addr = mmap(0,map->size,prot,MAP_PRIVATE,fd,0);
@@ -58,5 +60,5 @@ int mdso_map_input(
int mdso_unmap_input(struct mdso_input * map)
{
- return munmap(map->addr,map->size);
+ return map->size ? munmap(map->addr,map->size) : 0;
}