diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2017-07-14 16:11:43 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-15 11:44:13 +0200 |
commit | e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0 (patch) | |
tree | 666fe74e9c20ef46c43077ed17ddd6587d977440 | |
parent | 9d4dc84a769e3e45e420fbef7c7bb2acbbdccd8e (diff) | |
download | busybox-w32-e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0.tar.gz busybox-w32-e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0.tar.bz2 busybox-w32-e5b1f5af737078dfe4baba79dd0bc5a3b7616ad0.zip |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) | |||
119 | } | 119 | } |
120 | out: | 120 | out: |
121 | 121 | ||
122 | /* some environments don't have munmap(), hide it in #if */ | ||
123 | #if CONFIG_FEATURE_COPYBUF_KB > 4 | ||
122 | if (buffer_size > 4 * 1024) | 124 | if (buffer_size > 4 * 1024) |
123 | munmap(buffer, buffer_size); | 125 | munmap(buffer, buffer_size); |
126 | #endif | ||
124 | return status ? -1 : total; | 127 | return status ? -1 : total; |
125 | } | 128 | } |
126 | 129 | ||