[pacman-dev] [PATCH] Use fileno() in isatty() call

Dan McGee dan at archlinux.org
Thu Jan 12 08:47:49 EST 2012


This was our only use of the function that had a hardcoded file
descriptor.

Signed-off-by: Dan McGee <dan at archlinux.org>
---
 src/pacman/pacman.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 326664d..bce73d2 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -801,7 +801,7 @@ int main(int argc, char *argv[])
 	config = config_new();
 
 	/* disable progressbar if the output is redirected */
-	if(!isatty(1)) {
+	if(!isatty(fileno(stdout))) {
 		config->noprogressbar = 1;
 	}
 
-- 
1.7.8.3



More information about the pacman-dev mailing list