[git commit] copyfd: guard use of munmap() with #if (windows builds need this)

Denys Vlasenko vda.linux at googlemail.com
Sat Jul 15 09:44:13 UTC 2017


commit: https://git.busybox.net/busybox/commit/?id=e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/copyfd.c | 3 +++
 1 file changed, 3 insertions(+)

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;
 }
 


More information about the busybox-cvs mailing list