summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorJohannes Schindelin2017-07-14 16:11:43 +0200
committerDenys Vlasenko2017-07-15 11:44:13 +0200
commite5b1f5af737078dfe4baba79dd0bc5a3b7616ad0 (patch)
tree666fe74e9c20ef46c43077ed17ddd6587d977440 /libbb
parent9d4dc84a769e3e45e420fbef7c7bb2acbbdccd8e (diff)
downloadbusybox-e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0.zip
busybox-e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0.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>
Diffstat (limited to 'libbb')
-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;
}