summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin2017-07-14 16:11:43 +0200
committerDenys Vlasenko2017-07-18 19:20:58 +0200
commit3df48bdde96632a83cacff1f7795837a160de1d4 (patch)
tree6091b906aa54c1879fda37f07b09859450919d38
parent1f684bcde457d41f2dcb4451df27323924e13b68 (diff)
downloadbusybox-3df48bdde96632a83cacff1f7795837a160de1d4.zip
busybox-3df48bdde96632a83cacff1f7795837a160de1d4.tar.gz
copyfd: guard use of munmap() with #if (windows builds need this)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/copyfd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 7e35319..921fe3f 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -119,8 +119,11 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
}
out:
+/* some environments don't have munmap(), hide it in #if */
+#if CONFIG_FEATURE_COPYBUF_KB > 4
if (buffer_size > 4 * 1024)
munmap(buffer, buffer_size);
+#endif
return status ? -1 : total;
}