]> git.saurik.com Git - apt.git/commitdiff
* Use isatty rather than ttyname for checking if stdin ...
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:04:02 +0000 (17:04 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:04:02 +0000 (17:04 +0000)
Author: mdz
Date: 2003-11-19 23:50:51 GMT
* Use isatty rather than ttyname for checking if stdin is a terminal.
isatty has the advantage of not requiring /proc under Linux, and thus
Closes: #221728
cmdline/apt-cache.cc
cmdline/apt-cdrom.cc
cmdline/apt-get.cc
debian/changelog

index 046d6f76ca41000221ddd2adf9eb49ca6d6937f3..1933f60c640343275a9a015cb3bf340903adee49 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-cache.cc,v 1.67 2003/08/02 19:53:23 mdz Exp $
+// $Id: apt-cache.cc,v 1.68 2003/11/19 23:50:51 mdz Exp $
 /* ######################################################################
    
    apt-cache - Manages the cache files
@@ -1697,7 +1697,7 @@ int main(int argc,const char *argv[])
    }
    
    // Deal with stdout not being a tty
-   if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1)
+   if (isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
       _config->Set("quiet","1");
 
    if (CmdL.DispatchArg(CmdsA,false) == false && _error->PendingError() == false)
index ccb5af766ace84b1068242949135233a9b61748e..7367a55a316f23187e15e541806a0eae1bb0a097 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-cdrom.cc,v 1.44 2003/09/12 01:48:33 mdz Exp $
+// $Id: apt-cdrom.cc,v 1.45 2003/11/19 23:50:51 mdz Exp $
 /* ######################################################################
    
    APT CDROM - Tool for handling APT's CDROM database.
@@ -799,7 +799,7 @@ int main(int argc,const char *argv[])
       return ShowHelp();
 
    // Deal with stdout not being a tty
-   if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1)
+   if (isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
       _config->Set("quiet","1");
    
    // Match the operation
index 99cc35be61d773959c8d03847ed46514dd016247..2c7c99092cea680bc705b4b4cd3ca4dd228b1e22 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-get.cc,v 1.145 2003/11/10 07:09:53 mdz Exp $
+// $Id: apt-get.cc,v 1.146 2003/11/19 23:50:51 mdz Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -2468,7 +2468,7 @@ int main(int argc,const char *argv[])
    }
    
    // Deal with stdout not being a tty
-   if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1)
+   if (isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
       _config->Set("quiet","1");
 
    // Setup the output streams
index bfe9f6ebb62dbe9b2f62013db4e661dd43d8e62b..9207622fceb4f996767ab20fec02a33734dd00e7 100644 (file)
@@ -17,6 +17,9 @@ apt (0.5.15) unstable; urgency=low
   * Let apt-get build-dep try alternatives if the installed package
     doesn't meet version requirements (Closes: #214736)
   * Fix version display for recommends (Closes: #219900)
+  * Use isatty rather than ttyname for checking if stdin is a terminal.
+    isatty has the advantage of not requiring /proc under Linux, and thus
+    Closes: #221728
 
  --