libxbps: require a pointer to xbps_handle in functions that need it.
This removes 2 global vars from lib/initend.c and easier to know what functions require access to xbps_handle.
This commit is contained in:
@ -52,8 +52,6 @@ fetch_archive_open(struct archive *a, void *client_data)
|
||||
|
||||
(void)a;
|
||||
|
||||
xbps_dbg_printf("%s: establishing connection to `%s'...\n",
|
||||
__func__, f->url->host);
|
||||
f->fetch = fetchGet(f->url, NULL);
|
||||
if (f->fetch == NULL)
|
||||
return ENOENT;
|
||||
@ -69,9 +67,6 @@ fetch_archive_read(struct archive *a, void *client_data, const void **buf)
|
||||
(void)a;
|
||||
*buf = f->buffer;
|
||||
|
||||
xbps_dbg_printf("%s: fetching data from `%s'...\n",
|
||||
__func__, f->url->doc);
|
||||
|
||||
return fetchIO_read(f->fetch, f->buffer, sizeof(f->buffer));
|
||||
}
|
||||
|
||||
@ -82,11 +77,8 @@ fetch_archive_close(struct archive *a, void *client_data)
|
||||
|
||||
(void)a;
|
||||
|
||||
if (f->fetch != NULL) {
|
||||
xbps_dbg_printf("%s: closing connection to `%s'...\n",
|
||||
__func__, f->url->host);
|
||||
if (f->fetch != NULL)
|
||||
fetchIO_close(f->fetch);
|
||||
}
|
||||
free(f);
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user