1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-13 21:05:05 -05:00

code cleanup

This commit is contained in:
Aurelien Foret 2006-03-07 20:52:45 +00:00
parent fa5e6cef75
commit f0151aa587
3 changed files with 5 additions and 5 deletions

View File

@ -113,7 +113,7 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
if(newpkg == NULL) { if(newpkg == NULL) {
return(-1); return(-1);
} }
_alpm_log(PM_LOG_DEBUG, "adding entry %s in '%s' cache", newpkg->name, db->treename); _alpm_log(PM_LOG_DEBUG, "adding entry '%s' in '%s' cache", newpkg->name, db->treename);
db->pkgcache = _alpm_list_add_sorted(db->pkgcache, newpkg, pkg_cmp); db->pkgcache = _alpm_list_add_sorted(db->pkgcache, newpkg, pkg_cmp);
_alpm_db_free_grpcache(db); _alpm_db_free_grpcache(db);
@ -135,7 +135,7 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
return(-1); return(-1);
} }
_alpm_log(PM_LOG_DEBUG, "removing entry %s from '%s' cache", pkg->name, db->treename); _alpm_log(PM_LOG_DEBUG, "removing entry '%s' from '%s' cache", pkg->name, db->treename);
FREEPKG(data); FREEPKG(data);
_alpm_db_free_grpcache(db); _alpm_db_free_grpcache(db);

View File

@ -44,7 +44,6 @@ typedef struct __pmdb_t {
PMList *grpcache; PMList *grpcache;
} pmdb_t; } pmdb_t;
pmdb_t *_alpm_db_new(char *root, char *dbpath, char *treename); pmdb_t *_alpm_db_new(char *root, char *dbpath, char *treename);
void _alpm_db_free(void *data); void _alpm_db_free(void *data);
/* Prototypes for backends functions */ /* Prototypes for backends functions */

View File

@ -89,7 +89,8 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg)
newpkg = (pmpkg_t *)malloc(sizeof(pmpkg_t)); newpkg = (pmpkg_t *)malloc(sizeof(pmpkg_t));
if(newpkg == NULL) { if(newpkg == NULL) {
return(NULL); _alpm_log(PM_LOG_ERROR, "malloc failure: could not allocate %d bytes", sizeof(pmpkg_t));
RET_ERR(PM_ERR_MEMORY, NULL);
} }
STRNCPY(newpkg->name, pkg->name, PKG_NAME_LEN); STRNCPY(newpkg->name, pkg->name, PKG_NAME_LEN);
@ -258,7 +259,7 @@ pmpkg_t *_alpm_pkg_load(char *pkgfile)
info = _alpm_pkg_new(NULL, NULL); info = _alpm_pkg_new(NULL, NULL);
if(info == NULL) { if(info == NULL) {
tar_close(tar); tar_close(tar);
RET_ERR(PM_ERR_MEMORY, NULL); return(NULL);
} }
/* ORE /* ORE