summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-14 16:30:46 +0200
committerDan McGee <dan@archlinux.org>2011-06-14 16:30:46 +0200
commit76a991c117f3419e5cd630355b90876084d27c4b (patch)
tree56d3aaa9965f30d5cdcae14ba021cb7828ecc935 /lib/libalpm/remove.c
parentba63e31cc7ecc9e7fccb68e9fa4e09c90a8d5c66 (diff)
downloadpacman-76a991c117f3419e5cd630355b90876084d27c4b.tar.gz
pacman-76a991c117f3419e5cd630355b90876084d27c4b.tar.xz
Conflict check and skip_remove code cleanups
* Move several variables into better scope * const-ify a few variables * Avoid duplicating filelists if it is unnecessary * Better handling out out of memory condition when adding file conflicts to our list Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 264d79ea..eada9b95 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -192,13 +192,13 @@ int _alpm_remove_prepare(pmhandle_t *handle, alpm_list_t **data)
}
static int can_remove_file(pmhandle_t *handle, const char *path,
- alpm_list_t *skip)
+ alpm_list_t *skip_remove)
{
char file[PATH_MAX];
snprintf(file, PATH_MAX, "%s%s", handle->root, path);
- if(alpm_list_find_str(skip, file)) {
+ if(alpm_list_find_str(skip_remove, file)) {
/* return success because we will never actually remove this file */
return 1;
}
@@ -209,7 +209,7 @@ static int can_remove_file(pmhandle_t *handle, const char *path,
/* only return failure if the file ACTUALLY exists and we can't write to
* it - ignore "chmod -w" simple permission failures */
_alpm_log(handle, PM_LOG_ERROR, _("cannot remove file '%s': %s\n"),
- file, strerror(errno));
+ file, strerror(errno));
return 0;
}
}
@@ -219,7 +219,7 @@ static int can_remove_file(pmhandle_t *handle, const char *path,
/* Helper function for iterating through a package's file and deleting them
* Used by _alpm_remove_commit. */
-static void unlink_file(pmhandle_t *handle, pmpkg_t *info, char *filename,
+static void unlink_file(pmhandle_t *handle, pmpkg_t *info, const char *filename,
alpm_list_t *skip_remove, int nosave)
{
struct stat buf;
@@ -279,7 +279,7 @@ static void unlink_file(pmhandle_t *handle, pmpkg_t *info, char *filename,
if(unlink(file) == -1) {
_alpm_log(handle, PM_LOG_ERROR, _("cannot remove file '%s': %s\n"),
- filename, strerror(errno));
+ filename, strerror(errno));
}
}
}