copyfd: guard use of munmap() with #if (windows builds need this)
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 14 Jul 2017 14:11:43 +0000 (16:11 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 15 Jul 2017 09:44:13 +0000 (11:44 +0200)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/copyfd.c

index 7e353190372260f32627816b2efcd9cd4442a6e2..921fe3f81005d35063c8fb801cb54a75901586b8 100644 (file)
@@ -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;
 }