From fd3c512f88d43e6633bd3c3110cfa0bb321adaa8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 14 Dec 2020 18:25:28 +0100 Subject: libbb: create and use mmap() helpers function old new delta mmap_anon - 22 +22 mmap_read - 21 +21 xmmap_anon - 16 +16 rpm_gettags 465 447 -18 bb_full_fd_action 498 480 -18 uevent_main 337 310 -27 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 0/3 up/down: 59/-63) Total: -4 bytes Signed-off-by: Denys Vlasenko --- archival/rpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archival') diff --git a/archival/rpm.c b/archival/rpm.c index 68afba914..a4d850b46 100644 --- a/archival/rpm.c +++ b/archival/rpm.c @@ -145,7 +145,7 @@ static int rpm_gettags(const char *filename) /* remember size for munmap */ G.mapsize = storepos; /* some NOMMU systems prefer MAP_PRIVATE over MAP_SHARED */ - G.map = mmap(0, storepos, PROT_READ, MAP_PRIVATE, fd, 0); + G.map = mmap_read(fd, storepos); if (G.map == MAP_FAILED) bb_perror_msg_and_die("mmap '%s'", filename); -- cgit v1.2.3