summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-03-07 20:52:45 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-03-07 20:52:45 +0000
commitf0151aa587a074a51cb8a7b01b393ac0b61002d9 (patch)
treecaa4695c88101acf513856dee02f3c7fe5a57528
parentfa5e6cef759ad9e0f6c669c2b891d687599cac14 (diff)
downloadpacman-f0151aa587a074a51cb8a7b01b393ac0b61002d9.tar.xz
code cleanup
-rw-r--r--lib/libalpm/cache.c4
-rw-r--r--lib/libalpm/db.h1
-rw-r--r--lib/libalpm/package.c5
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c
index 76222ce2..c7ecb3f3 100644
--- a/lib/libalpm/cache.c
+++ b/lib/libalpm/cache.c
@@ -113,7 +113,7 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
if(newpkg == NULL) {
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);
_alpm_db_free_grpcache(db);
@@ -135,7 +135,7 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
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);
_alpm_db_free_grpcache(db);
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index 6d885efd..8e15a1a4 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -44,7 +44,6 @@ typedef struct __pmdb_t {
PMList *grpcache;
} pmdb_t;
-
pmdb_t *_alpm_db_new(char *root, char *dbpath, char *treename);
void _alpm_db_free(void *data);
/* Prototypes for backends functions */
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index b7d2cb5b..8150dd7c 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -89,7 +89,8 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg)
newpkg = (pmpkg_t *)malloc(sizeof(pmpkg_t));
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);
@@ -258,7 +259,7 @@ pmpkg_t *_alpm_pkg_load(char *pkgfile)
info = _alpm_pkg_new(NULL, NULL);
if(info == NULL) {
tar_close(tar);
- RET_ERR(PM_ERR_MEMORY, NULL);
+ return(NULL);
}
/* ORE