index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | lib/libalpm/handle.c | 35 |
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 36822285..c01dd551 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -23,7 +23,6 @@ #include <stdlib.h> #include <string.h> -#include <unistd.h> #include <limits.h> #include <sys/types.h> #include <syslog.h> @@ -36,10 +35,8 @@ #include "alpm_list.h" #include "util.h" #include "log.h" -#include "error.h" #include "trans.h" #include "alpm.h" -#include "server.h" /* global var for handle (private to libalpm) */ pmhandle_t *handle = NULL; @@ -55,8 +52,6 @@ pmhandle_t *_alpm_handle_new() handle->lckfd = -1; handle->logstream = NULL; - /* see if we're root or not */ - handle->uid = geteuid(); handle->root = NULL; handle->dbpath = NULL; handle->cachedirs = NULL; @@ -386,7 +381,7 @@ void SYMEXPORT alpm_option_set_cachedirs(alpm_list_t *cachedirs) int SYMEXPORT alpm_option_remove_cachedir(const char *cachedir) { - void *vdata = NULL; + char *vdata = NULL; char *newcachedir; size_t cachedirlen; /* verify cachedir ends in a '/' */ @@ -397,8 +392,7 @@ int SYMEXPORT alpm_option_remove_cachedir(const char *cachedir) newcachedir = calloc(cachedirlen + 1, sizeof(char)); strncpy(newcachedir, cachedir, cachedirlen); newcachedir[cachedirlen-1] = '/'; - handle->cachedirs = alpm_list_remove(handle->cachedirs, newcachedir, - _alpm_str_cmp, &vdata); + handle->cachedirs = alpm_list_remove_str(handle->cachedirs, newcachedir, &vdata); FREE(newcachedir); if(vdata != NULL) { FREE(vdata); @@ -451,9 +445,8 @@ void SYMEXPORT alpm_option_set_noupgrades(alpm_list_t *noupgrade) int SYMEXPORT alpm_option_remove_noupgrade(const char *pkg) { - void *vdata = NULL; - handle->noupgrade = alpm_list_remove(handle->noupgrade, pkg, - _alpm_str_cmp, &vdata); + char *vdata = NULL; + handle->noupgrade = alpm_list_remove_str(handle->noupgrade, pkg, &vdata); if(vdata != NULL) { FREE(vdata); return(1); @@ -474,9 +467,8 @@ void SYMEXPORT alpm_option_set_noextracts(alpm_list_t *noextract) int SYMEXPORT alpm_option_remove_noextract(const char *pkg) { - void *vdata = NULL; - handle->noextract = alpm_list_remove(handle->noextract, pkg, - _alpm_str_cmp, &vdata); + char *vdata = NULL; + handle->noextract = alpm_list_remove_str(handle->noextract, pkg, &vdata); if(vdata != NULL) { FREE(vdata); return(1); @@ -497,9 +489,8 @@ void SYMEXPORT alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs) int SYMEXPORT alpm_option_remove_ignorepkg(const char *pkg) { - void *vdata = NULL; - handle->ignorepkg = alpm_list_remove(handle->ignorepkg, pkg, - _alpm_str_cmp, &vdata); + char *vdata = NULL; + handle->ignorepkg = alpm_list_remove_str(handle->ignorepkg, pkg, &vdata); if(vdata != NULL) { FREE(vdata); return(1); @@ -520,9 +511,8 @@ void SYMEXPORT alpm_option_set_holdpkgs(alpm_list_t *holdpkgs) int SYMEXPORT alpm_option_remove_holdpkg(const char *pkg) { - void *vdata = NULL; - handle->holdpkg = alpm_list_remove(handle->holdpkg, pkg, - _alpm_str_cmp, &vdata); + char *vdata = NULL; + handle->holdpkg = alpm_list_remove_str(handle->holdpkg, pkg, &vdata); if(vdata != NULL) { FREE(vdata); return(1); @@ -543,9 +533,8 @@ void SYMEXPORT alpm_option_set_ignoregrps(alpm_list_t *ignoregrps) int SYMEXPORT alpm_option_remove_ignoregrp(const char *grp) { - void *vdata = NULL; - handle->ignoregrp = alpm_list_remove(handle->ignoregrp, grp, - _alpm_str_cmp, &vdata); + char *vdata = NULL; + handle->ignoregrp = alpm_list_remove_str(handle->ignoregrp, grp, &vdata); if(vdata != NULL) { FREE(vdata); return(1); |