Remove FREEHANDLE macro and correctly type _alpm_handle_free
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
69bc2e62fe
commit
0984dab1f2
|
@ -112,7 +112,7 @@ int SYMEXPORT alpm_release()
|
||||||
db = NULL;
|
db = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FREEHANDLE(handle);
|
_alpm_handle_free(handle);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,11 +87,13 @@ pmhandle_t *_alpm_handle_new()
|
||||||
return(handle);
|
return(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _alpm_handle_free(pmhandle_t *handle)
|
void _alpm_handle_free(pmhandle_t *handle)
|
||||||
{
|
{
|
||||||
ALPM_LOG_FUNC;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
if(handle == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* close logfiles */
|
/* close logfiles */
|
||||||
if(handle->logfd) {
|
if(handle->logfd) {
|
||||||
|
@ -116,8 +118,6 @@ int _alpm_handle_free(pmhandle_t *handle)
|
||||||
FREELIST(handle->ignorepkg);
|
FREELIST(handle->ignorepkg);
|
||||||
FREELIST(handle->holdpkg);
|
FREELIST(handle->holdpkg);
|
||||||
FREE(handle);
|
FREE(handle);
|
||||||
|
|
||||||
return(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
alpm_cb_log alpm_option_get_logcb() { return (handle ? handle->logcb : NULL); }
|
alpm_cb_log alpm_option_get_logcb() { return (handle ? handle->logcb : NULL); }
|
||||||
|
|
|
@ -69,10 +69,8 @@ typedef struct _pmhandle_t {
|
||||||
|
|
||||||
extern pmhandle_t *handle;
|
extern pmhandle_t *handle;
|
||||||
|
|
||||||
#define FREEHANDLE(p) do { if (p) { _alpm_handle_free(p); p = NULL; } } while (0)
|
|
||||||
|
|
||||||
pmhandle_t *_alpm_handle_new();
|
pmhandle_t *_alpm_handle_new();
|
||||||
int _alpm_handle_free(pmhandle_t *handle);
|
void _alpm_handle_free(pmhandle_t *handle);
|
||||||
|
|
||||||
#endif /* _ALPM_HANDLE_H */
|
#endif /* _ALPM_HANDLE_H */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue