diff options
author | Dan McGee <dan@archlinux.org> | 2007-04-25 17:24:23 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-04-26 14:34:41 -0400 |
commit | 97313ba31645796148c3f413d9ebde365df06dbe (patch) | |
tree | 95a937c665c4ecb57c21df645292c616451794ae /src/pacman/conf.c | |
parent | da3286a80d10ea3896ae09e9e753dc4f19fa3bf6 (diff) |
More pacman side cleanup
* Cleaned up more of the header #includes, and got rid of a lot of stuff
that was due to trying to make it compile on BSD/Darwin/CYGWIN. We can
add it later but lets keep it simple for now and do it in seperate files
if possible later.
* Removed a lot of #define MACROS. Some were not even used, and others were
only used a few times.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/conf.c')
-rw-r--r-- | src/pacman/conf.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 8a438269..3409f8d3 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -24,21 +24,16 @@ #include <stdlib.h> #include <stdio.h> -#include <alpm.h> - /* pacman */ #include "conf.h" -#include "pacman.h" -#include "util.h" -#include "log.h" config_t *config_new(void) { - config_t *config; - - MALLOC(config, sizeof(config_t)); - - memset(config, 0, sizeof(config_t)); + config_t *config = calloc(1, sizeof(config_t)); + if(!config) { + fprintf(stderr, "malloc failure: could not allocate %d bytes\n", + sizeof(config_t)); + } return(config); } @@ -49,8 +44,9 @@ int config_free(config_t *config) return(-1); } - FREE(config->configfile); + free(config->configfile); free(config); + config = NULL; return(0); } |