From 66a9b5314123b3632cb90a4d37fd422a0f898568 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 18 Jan 2013 20:42:21 -0500 Subject: add caller prefix to alpm_logaction prefix defaults to "UNKOWN" if null or an empty string is provided. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/remove.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/libalpm/remove.c') 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; } } -- cgit v1.2.3-54-g00ecf