From 0972b7acfd7c8fadb6aeec6606ea85bf6c5d3d3d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 16 Mar 2012 17:05:06 -0500 Subject: Pass a file descriptor to getcols and flush_term_input This makes these methods a bit more flexible. Signed-off-by: Dan McGee --- src/pacman/callback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pacman/callback.c') diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 9fd9cc43..61f517c9 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -384,7 +384,7 @@ void cb_progress(alpm_progress_t event, const char *pkgname, int percent, int len, wclen, wcwid, padwid; wchar_t *wcstr; - const unsigned short cols = getcols(); + const unsigned short cols = getcols(fileno(stdout)); if(config->noprogressbar || cols == 0) { return; @@ -544,7 +544,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) const char *rate_label, *xfered_label; int file_percent = 0, total_percent = 0; - const unsigned short cols = getcols(); + const unsigned short cols = getcols(fileno(stdout)); if(config->noprogressbar || cols == 0 || file_total == -1) { if(file_xfered == 0) { -- cgit v1.2.3-24-g4f1b