diff options
author | midipix <writeonce@midipix.org> | 2021-05-13 08:35:49 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-05-13 08:35:49 +0000 |
commit | 682a4c468d4cf85e8d43fa7b81d6c527321f1812 (patch) | |
tree | bcf436cf8c040ea11ce60f4adf6536fea3d70667 /src | |
parent | 8ee4f12b00c0922e65ce04721d38968f81c18164 (diff) | |
download | mdso-682a4c468d4cf85e8d43fa7b81d6c527321f1812.tar.bz2 mdso-682a4c468d4cf85e8d43fa7b81d6c527321f1812.tar.xz |
mdso_map_input(): close the newly opened fd with an empty input file.
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/mdso_map_input.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/helper/mdso_map_input.c b/src/helper/mdso_map_input.c index ab4607f..b7a2677 100644 --- a/src/helper/mdso_map_input.c +++ b/src/helper/mdso_map_input.c @@ -48,12 +48,11 @@ int mdso_map_input( if (st.st_size == 0) { map->size = 0; map->addr = 0; - return 0; + } else { + map->size = st.st_size; + map->addr = mmap(0,map->size,prot,MAP_PRIVATE,fd,0); } - map->size = st.st_size; - map->addr = mmap(0,map->size,prot,MAP_PRIVATE,fd,0); - if (fnew) close(fd); |