summaryrefslogtreecommitdiff
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-01-18 20:42:21 -0500
committerAllan McRae <allan@archlinux.org>2013-01-28 23:38:46 +1000
commit66a9b5314123b3632cb90a4d37fd422a0f898568 (patch)
tree689776d6536072ed623813fae6e088969d01498f /lib/libalpm/remove.c
parent8308c7b320ae230252ff0e79ea18cbfed0d13e81 (diff)
downloadpacman-66a9b5314123b3632cb90a4d37fd422a0f898568.tar.xz
add caller prefix to alpm_logaction
prefix defaults to "UNKOWN" if null or an empty string is provided. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index cdc572d9..50fc93ca 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -479,13 +479,15 @@ static int unlink_file(alpm_handle_t *handle, alpm_pkg_t *oldpkg,
if(rename(file, newpath)) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
file, newpath, strerror(errno));
- alpm_logaction(handle, "error: could not rename %s to %s (%s)\n",
+ alpm_logaction(handle, ALPM_CALLER_PREFIX,
+ "error: could not rename %s to %s (%s)\n",
file, newpath, strerror(errno));
free(newpath);
return -1;
}
_alpm_log(handle, ALPM_LOG_WARNING, _("%s saved as %s\n"), file, newpath);
- alpm_logaction(handle, "warning: %s saved as %s\n", file, newpath);
+ alpm_logaction(handle, ALPM_CALLER_PREFIX,
+ "warning: %s saved as %s\n", file, newpath);
free(newpath);
return 0;
}
@@ -497,8 +499,8 @@ static int unlink_file(alpm_handle_t *handle, alpm_pkg_t *oldpkg,
if(unlink(file) == -1) {
_alpm_log(handle, ALPM_LOG_ERROR, _("cannot remove %s (%s)\n"),
file, strerror(errno));
- alpm_logaction(handle, "error: cannot remove %s (%s)\n",
- file, strerror(errno));
+ alpm_logaction(handle, ALPM_CALLER_PREFIX,
+ "error: cannot remove %s (%s)\n", file, strerror(errno));
return -1;
}
}