Define ARCHIVE_READ_BLOCKSIZE and use it rather than using magic numbers.
--HG-- extra : convert_revision : b8e6755400eb6f2bef0ea1eb25a258f9ed1714c2
This commit is contained in:
parent
053abca5ef
commit
58c6a31297
|
@ -98,7 +98,8 @@ repoidx_addpkg(const char *file, const char *filename, const char *pkgdir)
|
|||
archive_read_support_compression_all(ar);
|
||||
archive_read_support_format_all(ar);
|
||||
|
||||
if ((rv = archive_read_open_filename(ar, file, 2048)) == -1) {
|
||||
if ((rv = archive_read_open_filename(ar, file,
|
||||
ARCHIVE_READ_BLOCKSIZE)) == -1) {
|
||||
archive_read_finish(ar);
|
||||
return errno;
|
||||
}
|
||||
|
|
|
@ -59,6 +59,8 @@
|
|||
/* Verbose messages */
|
||||
#define XBPS_VERBOSE 0x00000001
|
||||
|
||||
#define ARCHIVE_READ_BLOCKSIZE 2048
|
||||
|
||||
/* from lib/cmpver.c */
|
||||
int xbps_cmpver_packages(const char *, const char *);
|
||||
int xbps_cmpver_versions(const char *, const char *);
|
||||
|
|
|
@ -92,7 +92,8 @@ unpack_archive_init(prop_dictionary_t pkg, const char *binfile)
|
|||
archive_read_support_format_all(ar);
|
||||
|
||||
/* 2048 is arbitrary... dunno what value is better. */
|
||||
if ((rv = archive_read_open_fd(ar, pkg_fd, 2048)) != 0) {
|
||||
if ((rv = archive_read_open_fd(ar, pkg_fd,
|
||||
ARCHIVE_READ_BLOCKSIZE)) != 0) {
|
||||
archive_read_finish(ar);
|
||||
(void)close(pkg_fd);
|
||||
return rv;
|
||||
|
|
Loading…
Reference in New Issue
Block a user