From 3c3cb001a441656c2afba62f0361b83d4987339c Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 11 May 2008 13:30:27 +1000 Subject: Make all error messages use pm_fprintf Tested using many easily generated error conditions. Also added "malloc failure" (conf.c) and "segmentation fault" (pacman.c) error messages for translation. Signed-off-by: Allan McRae [Dan: fix trailing whitespace errors, other compilation issues] Signed-off-by: Dan McGee --- src/pacman/remove.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pacman/remove.c') diff --git a/src/pacman/remove.c b/src/pacman/remove.c index a2209ac6..4fe9bc81 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -86,7 +86,7 @@ int pacman_remove(alpm_list_t *targets) for(i = finaltargs; i; i = alpm_list_next(i)) { char *targ = alpm_list_getdata(i); if(alpm_trans_addtarget(targ) == -1) { - fprintf(stderr, _("error: '%s': %s\n"), + pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", targ, alpm_strerrorlast()); trans_release(); FREELIST(finaltargs); @@ -96,7 +96,7 @@ int pacman_remove(alpm_list_t *targets) /* Step 2: prepare the transaction based on its type, targets and flags */ if(alpm_trans_prepare(&data) == -1) { - fprintf(stderr, _("error: failed to prepare transaction (%s)\n"), + pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerrorlast()); switch(pm_errno) { case PM_ERR_UNSATISFIED_DEPS: @@ -142,7 +142,7 @@ int pacman_remove(alpm_list_t *targets) /* Step 3: actually perform the removal */ if(alpm_trans_commit(NULL) == -1) { - fprintf(stderr, _("error: failed to commit transaction (%s)\n"), + pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"), alpm_strerrorlast()); trans_release(); FREELIST(finaltargs); -- cgit v1.2.3