From 6f9a7095d1302aa51ed21314a748a62fc092a681 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Fri, 25 Apr 2008 08:33:27 +0000 Subject: [PATCH] change fd 1 to STDOUT_FILENO --- src/output/OutNormal.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/output/OutNormal.cc b/src/output/OutNormal.cc index cec650e..261c270 100644 --- a/src/output/OutNormal.cc +++ b/src/output/OutNormal.cc @@ -83,7 +83,7 @@ static void display_progress ( const std::string & id, const string & s, int per { static AliveCursor cursor; - if (isatty(1)) + if (isatty(STDOUT_FILENO)) { cout << CLEARLN << cursor++ << " " << s; // dont display percents if invalid @@ -101,7 +101,7 @@ static void display_tick ( const std::string & id, const string & s) { static AliveCursor cursor; - if (isatty(1)) + if (isatty(STDOUT_FILENO)) { cursor++; cout << CLEARLN << cursor << " " << s; @@ -122,7 +122,7 @@ void OutNormal::progressStart(const std::string & id, if (progressFilter()) return; - if (!isatty(1)) + if (!isatty(STDOUT_FILENO)) cout << label << ' '; if (is_tick) @@ -148,7 +148,7 @@ void OutNormal::progressEnd(const std::string & id, const string & label, bool e return; static AliveCursor cursor; - if (isatty(1)) + if (isatty(STDOUT_FILENO)) cout << CLEARLN << cursor.done() << " " << label << std::flush << endl; else cout << cursor.done() << std::flush << endl; @@ -161,7 +161,7 @@ void OutNormal::dwnldProgressStart(const zypp::Url & uri) return; static AliveCursor cursor; - if (isatty(1)) + if (isatty(STDOUT_FILENO)) cout << CLEARLN << cursor << " " << _("Downloading:") << " "; else cout << _("Downloading:") << " "; @@ -169,7 +169,7 @@ void OutNormal::dwnldProgressStart(const zypp::Url & uri) cout << uri; //! \todo shorten to fit the width of the terminal else cout << zypp::Pathname(uri.getPathName()).basename(); - if (isatty(1)) + if (isatty(STDOUT_FILENO)) cout << " [" << _("starting") << "]"; //! \todo align to the right else cout << " [" ; @@ -182,7 +182,7 @@ void OutNormal::dwnldProgress(const zypp::Url & uri, { if (verbosity() < NORMAL) return; - if (!isatty(1)) + if (!isatty(STDOUT_FILENO)) { cout << '.' << std::flush; return; @@ -214,7 +214,7 @@ void OutNormal::dwnldProgressEnd(const zypp::Url & uri, long rate, bool error) return; static AliveCursor cursor; - if (isatty(1)) + if (isatty(STDOUT_FILENO)) { cout << CLEARLN << cursor.done() << " " << _("Downloading:") << " "; if (verbosity() == DEBUG) -- 2.7.4