summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-21 17:44:19 +0200
committerDan McGee <dan@archlinux.org>2011-10-21 17:45:18 +0200
commit9e9ecf218344cea86d6b8c6cf7cd246bcfcca98b (patch)
tree88ed783b6008148b670bb17f691aaf9d95f3bacb /src/pacman/util.c
parent45f86ca1ca712857e6f84288cf818ce5707fc345 (diff)
downloadpacman-9e9ecf218344cea86d6b8c6cf7cd246bcfcca98b.tar.gz
pacman-9e9ecf218344cea86d6b8c6cf7cd246bcfcca98b.tar.xz
Remove pm_fprintf() in favor of pm_printf()
Now that pm_printf() always prints to stderr, we don't need this second function that was always used with stderr as the first argument. Thus, this patch removes the function and makes the following sed replacement: sed -i -e 's#pm_fprintf(stderr, #pm_printf(#g' src/pacman/*.c Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 1ca9b4d6..1b0625ea 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -66,7 +66,7 @@ int trans_init(alpm_transflag_t flags, int check_valid)
void trans_init_error(void)
{
enum _alpm_errno_t err = alpm_errno(config->handle);
- pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to init transaction (%s)\n"),
+ pm_printf(ALPM_LOG_ERROR, _("failed to init transaction (%s)\n"),
alpm_strerror(err));
if(err == ALPM_ERR_HANDLE_LOCK) {
fprintf(stderr, _(" if you're sure a package manager is not already\n"
@@ -78,7 +78,7 @@ void trans_init_error(void)
int trans_release(void)
{
if(alpm_trans_release(config->handle) == -1) {
- pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to release transaction (%s)\n"),
+ pm_printf(ALPM_LOG_ERROR, _("failed to release transaction (%s)\n"),
alpm_strerror(alpm_errno(config->handle)));
return -1;
}
@@ -585,7 +585,7 @@ int table_display(const char *title, const alpm_list_t *header,
totalwidth = table_calc_widths(header, rows, totalcols, &widths);
/* return -1 if terminal is not wide enough */
if(totalwidth > getcols()) {
- pm_fprintf(stderr, ALPM_LOG_WARNING,
+ pm_printf(ALPM_LOG_WARNING,
_("insufficient columns available for table display\n"));
return -1;
}
@@ -743,7 +743,7 @@ void signature_display(const char *title, alpm_siglist_t *siglist)
ret = pm_asprintf(&sigline, _("%s, %s from \"%s\""),
status, validity, name);
if(ret == -1) {
- pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to allocate string\n"));
+ pm_printf(ALPM_LOG_ERROR, _("failed to allocate string\n"));
continue;
}
indentprint(sigline, len);
@@ -1423,19 +1423,6 @@ int pm_printf(alpm_loglevel_t level, const char *format, ...)
return ret;
}
-int pm_fprintf(FILE *stream, alpm_loglevel_t level, const char *format, ...)
-{
- int ret;
- va_list args;
-
- /* print the message using va_arg list */
- va_start(args, format);
- ret = pm_vfprintf(stream, level, format, args);
- va_end(args);
-
- return ret;
-}
-
int pm_asprintf(char **string, const char *format, ...)
{
int ret = 0;
@@ -1444,7 +1431,7 @@ int pm_asprintf(char **string, const char *format, ...)
/* print the message using va_arg list */
va_start(args, format);
if(vasprintf(string, format, args) == -1) {
- pm_fprintf(stderr, ALPM_LOG_ERROR, _("failed to allocate string\n"));
+ pm_printf(ALPM_LOG_ERROR, _("failed to allocate string\n"));
ret = -1;
}
va_end(args);