index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2007-04-26 20:29:12 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-04-28 01:54:10 -0400 |
commit | 0984dab1f2b7beae455518b06aa5675890e01d9c (patch) | |
tree | e85f1e40c3d28c35324df7c4b58a7638186424c8 /lib/libalpm | |
parent | 69bc2e62fe2b94bb1189959e4ed396ffbf5088e1 (diff) |
-rw-r--r-- | lib/libalpm/alpm.c | 2 | ||||
-rw-r--r-- | lib/libalpm/handle.c | 8 | ||||
-rw-r--r-- | lib/libalpm/handle.h | 4 |
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 63b418c1..fd467bfc 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -112,7 +112,7 @@ int SYMEXPORT alpm_release() db = NULL; } - FREEHANDLE(handle); + _alpm_handle_free(handle); return(0); } diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index de80eb8f..cbbdeff5 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -87,11 +87,13 @@ pmhandle_t *_alpm_handle_new() return(handle); } -int _alpm_handle_free(pmhandle_t *handle) +void _alpm_handle_free(pmhandle_t *handle) { ALPM_LOG_FUNC; - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); + if(handle == NULL) { + return; + } /* close logfiles */ if(handle->logfd) { @@ -116,8 +118,6 @@ int _alpm_handle_free(pmhandle_t *handle) FREELIST(handle->ignorepkg); FREELIST(handle->holdpkg); FREE(handle); - - return(0); } alpm_cb_log alpm_option_get_logcb() { return (handle ? handle->logcb : NULL); } diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index 35e5eb23..0790ad13 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -69,10 +69,8 @@ typedef struct _pmhandle_t { extern pmhandle_t *handle; -#define FREEHANDLE(p) do { if (p) { _alpm_handle_free(p); p = NULL; } } while (0) - pmhandle_t *_alpm_handle_new(); -int _alpm_handle_free(pmhandle_t *handle); +void _alpm_handle_free(pmhandle_t *handle); #endif /* _ALPM_HANDLE_H */ |