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>
This commit is contained in:
Johannes Schindelin 2017-07-14 16:11:43 +02:00 committed by Denys Vlasenko
parent 9d4dc84a76
commit e5b1f5af73

View File

@ -119,8 +119,11 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
} }
out: out:
/* some environments don't have munmap(), hide it in #if */
#if CONFIG_FEATURE_COPYBUF_KB > 4
if (buffer_size > 4 * 1024) if (buffer_size > 4 * 1024)
munmap(buffer, buffer_size); munmap(buffer, buffer_size);
#endif
return status ? -1 : total; return status ? -1 : total;
} }