summaryrefslogtreecommitdiffstats
path: root/src/pacman/callback.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-16 23:05:06 +0100
committerDan McGee <dan@archlinux.org>2012-03-16 23:05:35 +0100
commit0972b7acfd7c8fadb6aeec6606ea85bf6c5d3d3d (patch)
treeeac0152b16a64fd2bcc6699f983a40b57398d9e0 /src/pacman/callback.c
parente6f72c61a098b52ea29e54b8eb4739a2ff81e6b0 (diff)
downloadpacman-0972b7acfd7c8fadb6aeec6606ea85bf6c5d3d3d.tar.gz
pacman-0972b7acfd7c8fadb6aeec6606ea85bf6c5d3d3d.tar.xz
Pass a file descriptor to getcols and flush_term_input
This makes these methods a bit more flexible. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/callback.c')
-rw-r--r--src/pacman/callback.c4
1 files changed, 2 insertions, 2 deletions
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) {