rpmio: Lower memory limit on 32-bit systems for xz compression

For some systems 128 MiB delta is not enough for `w7T.xzdio`. Found by
experiment that 256 MiB is enough.

Fixes:

  error: create archive failed on file /usr/src/in/source/FlightGear-data-2020.1.2.tar: cpio: write failed - Bad file descriptor
This commit is contained in:
Виталий Чикунов 2020-12-13 02:28:31 +03:00
parent e3d73c95d5
commit afe6605589

View File

@ -2886,7 +2886,7 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x
if ((personality(0xffffffff) & PER_MASK) == PER_LINUX32)
memlimit = SIZE_MAX; /* 4 GiB */
memlimit -= SIZE_MAX >> 5; /* 128 MiB */
memlimit -= SIZE_MAX >> 4; /* 256 MiB */
/* keep reducing the number of threads until memory usage gets below limit */
while ((memory_usage = lzma_stream_encoder_mt_memusage(&mt_options)) > memlimit) {
@ -2899,7 +2899,6 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x
}
}
#endif
ret = lzma_stream_encoder_mt(&lzfile->strm, &mt_options);
}
#endif