diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2006-03-02 20:02:35 +0100 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2006-03-02 20:02:35 +0100 |
commit | 3eebe8fc2b641737c0581066034f29ce573900d5 (patch) | |
tree | 786427248226551938abe1896de30cd3bf7cde57 /lib/libalpm | |
parent | 79f4b5acf407e6fdf054de323e11c9b5a4f97580 (diff) | |
download | pacman-3eebe8fc2b641737c0581066034f29ce573900d5.tar.gz pacman-3eebe8fc2b641737c0581066034f29ce573900d5.tar.xz |
code cleanup
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/group.c | 7 | ||||
-rw-r--r-- | lib/libalpm/list.h | 4 | ||||
-rw-r--r-- | lib/libalpm/remove.c | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/lib/libalpm/group.c b/lib/libalpm/group.c index a77a8eef..af769575 100644 --- a/lib/libalpm/group.c +++ b/lib/libalpm/group.c @@ -25,7 +25,10 @@ #include <string.h> /* pacman */ #include "util.h" +#include "error.h" +#include "log.h" #include "group.h" +#include "alpm.h" pmgrp_t *_alpm_grp_new() { @@ -33,7 +36,9 @@ pmgrp_t *_alpm_grp_new() grp = (pmgrp_t *)malloc(sizeof(pmgrp_t)); if(grp == NULL) { - return(NULL); + _alpm_log(PM_LOG_ERROR, "malloc failure: could not allocate %d bytes", + sizeof(pmgrp_t)); + RET_ERR(PM_ERR_MEMORY, NULL); } grp->name[0] = '\0'; diff --git a/lib/libalpm/list.h b/lib/libalpm/list.h index 7cfc886f..74da9a00 100644 --- a/lib/libalpm/list.h +++ b/lib/libalpm/list.h @@ -35,9 +35,9 @@ typedef struct __pmlist_t PMList; #define FREELIST(p) _FREELIST(p, free) #define FREELISTPTR(p) _FREELIST(p, NULL) -typedef void (*_alpm_fn_free) (void *); +typedef void (*_alpm_fn_free)(void *); /* Sort comparison callback function declaration */ -typedef int (*_alpm_fn_cmp) (const void *, const void *); +typedef int (*_alpm_fn_cmp)(const void *, const void *); PMList *_alpm_list_new(void); void _alpm_list_free(PMList *list, _alpm_fn_free fn); diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 7ae22216..fd040e38 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -25,9 +25,7 @@ #include <time.h> #include <fcntl.h> #include <string.h> -#ifdef CYGWIN -#include <limits.h> /* PATH_MAX */ -#endif +#include <limits.h> #include <zlib.h> #include <libtar.h> /* pacman */ |