diff options
-rw-r--r-- | src/pacman/add.c | 2 | ||||
-rw-r--r-- | src/pacman/conf.c | 12 | ||||
-rw-r--r-- | src/pacman/conf.h | 10 | ||||
-rw-r--r-- | src/pacman/download.c | 2 | ||||
-rw-r--r-- | src/pacman/log.c | 4 | ||||
-rw-r--r-- | src/pacman/pacman.c | 3 | ||||
-rw-r--r-- | src/pacman/query.c | 2 | ||||
-rw-r--r-- | src/pacman/remove.c | 2 | ||||
-rw-r--r-- | src/pacman/sync.c | 2 | ||||
-rw-r--r-- | src/pacman/upgrade.c | 2 |
10 files changed, 21 insertions, 20 deletions
diff --git a/src/pacman/add.c b/src/pacman/add.c index 960f5eed..d36f19a8 100644 --- a/src/pacman/add.c +++ b/src/pacman/add.c @@ -31,7 +31,7 @@ #include "trans.h" #include "conf.h" -extern pmconfig_t *config; +extern config_t *config; int pacman_add(list_t *targets) { diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 7f407535..72031a5f 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -38,21 +38,21 @@ extern list_t *pmc_syncs; -pmconfig_t *config_new() +config_t *config_new() { - pmconfig_t *config; + config_t *config; - config = (pmconfig_t *)malloc(sizeof(pmconfig_t)); + config = (config_t *)malloc(sizeof(config_t)); if(config == NULL) { return(NULL); } - memset(config, 0, sizeof(pmconfig_t)); + memset(config, 0, sizeof(config_t)); return(config); } -int config_free(pmconfig_t *config) +int config_free(config_t *config) { if(config == NULL) { return(-1); @@ -71,7 +71,7 @@ int config_free(pmconfig_t *config) return(0); } -int parseconfig(pmconfig_t *config) +int parseconfig(config_t *config) { FILE *fp = NULL; char line[PATH_MAX+1]; diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 390f84a2..2af5c430 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -21,7 +21,7 @@ #ifndef _PM_CONF_H #define _PM_CONF_H -typedef struct __pmconfig_t { +typedef struct __config_t { /* command line options */ char *root; char *dbpath; @@ -59,12 +59,12 @@ typedef struct __pmconfig_t { unsigned short chomp; unsigned short nopassiveftp; list_t *holdpkg; -} pmconfig_t; +} config_t; #define FREECONF(p) do { if(p) { config_free(p); p = NULL; } } while(0) -pmconfig_t *config_new(); -int config_free(pmconfig_t *config); -int parseconfig(pmconfig_t *config); +config_t *config_new(); +int config_free(config_t *config); +int parseconfig(config_t *config); #endif /* _PM_CONF_H */ diff --git a/src/pacman/download.c b/src/pacman/download.c index 5f237b6c..4cd1596a 100644 --- a/src/pacman/download.c +++ b/src/pacman/download.c @@ -46,7 +46,7 @@ static int xfered1; static unsigned char eta_h, eta_m, eta_s; /* pacman options */ -extern pmconfig_t *config; +extern config_t *config; extern int maxcols; diff --git a/src/pacman/log.c b/src/pacman/log.c index 6ff488a9..31a3152a 100644 --- a/src/pacman/log.c +++ b/src/pacman/log.c @@ -33,7 +33,7 @@ #define LOG_STR_LEN 256 -extern pmconfig_t *config; +extern config_t *config; static int neednl; /* for cleaner message output */ @@ -41,7 +41,7 @@ static int neednl; /* for cleaner message output */ */ void cb_log(unsigned short level, char *msg) { - char str[8] = ""; + char str[9] = ""; switch(level) { case PM_LOG_DEBUG: diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 418a1591..af1ef932 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -48,7 +48,7 @@ #include "sync.h" #include "pacman.h" -pmconfig_t *config = NULL; +config_t *config = NULL; PM_DB *db_local; /* list of (sync_t *) structs for sync locations */ @@ -95,6 +95,7 @@ int main(int argc, char *argv[]) /* parse the command line */ ret = parseargs(argc, argv); if(ret != 0) { + config_free(config); exit(ret); } diff --git a/src/pacman/query.c b/src/pacman/query.c index ce444c48..f2b74c83 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -34,7 +34,7 @@ #include "log.h" #include "conf.h" -extern pmconfig_t *config; +extern config_t *config; extern PM_DB *db_local; static int query_fileowner(PM_DB *db, char *filename) diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 100e22f3..2859155b 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -31,7 +31,7 @@ #include "trans.h" #include "conf.h" -extern pmconfig_t *config; +extern config_t *config; extern PM_DB *db_local; diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 968632f4..d72200fe 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -43,7 +43,7 @@ #include "pacman.h" #include "conf.h" -extern pmconfig_t *config; +extern config_t *config; extern PM_DB *db_local; extern list_t *pmc_syncs; diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index 283c1a98..0aa7c45d 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -29,7 +29,7 @@ #include "add.h" #include "conf.h" -extern pmconfig_t *config; +extern config_t *config; int pacman_upgrade(list_t *targets) { |