aboutsummaryrefslogtreecommitdiff
path: root/archival/rpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/rpm.c')
-rw-r--r--archival/rpm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/archival/rpm.c b/archival/rpm.c
index 790eeb59d..700f90979 100644
--- a/archival/rpm.c
+++ b/archival/rpm.c
@@ -140,6 +140,7 @@ static int rpm_gettags(const char *filename)
140 } 140 }
141 G.mytags = tags; 141 G.mytags = tags;
142 142
143#if !ENABLE_PLATFORM_MINGW32
143 /* Map the store */ 144 /* Map the store */
144 storepos = (storepos + G.pagesize) & -(int)G.pagesize; 145 storepos = (storepos + G.pagesize) & -(int)G.pagesize;
145 /* remember size for munmap */ 146 /* remember size for munmap */
@@ -148,6 +149,14 @@ static int rpm_gettags(const char *filename)
148 G.map = mmap(0, storepos, PROT_READ, MAP_PRIVATE, fd, 0); 149 G.map = mmap(0, storepos, PROT_READ, MAP_PRIVATE, fd, 0);
149 if (G.map == MAP_FAILED) 150 if (G.map == MAP_FAILED)
150 bb_perror_msg_and_die("mmap '%s'", filename); 151 bb_perror_msg_and_die("mmap '%s'", filename);
152#else
153# undef munmap
154# define munmap(p, l) free(p)
155 /* Allocate memory for the store */
156 G.map = xmalloc(storepos);
157 xlseek(fd, 0, SEEK_SET);
158 full_read(fd, G.map, storepos);
159#endif
151 160
152 return fd; 161 return fd;
153} 162}