From: Johannes Schindelin Date: Fri, 14 Jul 2017 14:11:43 +0000 (+0200) Subject: copyfd: guard use of munmap() with #if (windows builds need this) X-Git-Tag: 1_28_0~397 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0;p=oweals%2Fbusybox.git copyfd: guard use of munmap() with #if (windows builds need this) Signed-off-by: Johannes Schindelin Signed-off-by: Denys Vlasenko --- diff --git a/libbb/copyfd.c b/libbb/copyfd.c index 7e3531903..921fe3f81 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; }