]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tee: use STDIN_FILENO rather than 0
authorMartin Castillo <castilma@uni-bremen.de>
Sat, 30 Mar 2019 22:04:06 +0000 (15:04 -0700)
committerPádraig Brady <P@draigBrady.com>
Sat, 30 Mar 2019 22:04:42 +0000 (15:04 -0700)
* src/tee.c (tee_files): Use the name rather than the value.
Addresses https://bugs.gnu.org/35041

src/tee.c

index 4fc2c7b66ab9b1896220e9fbfa4d7ead8a9a793e..d3aecc7b13a45247d1b6e01dc4bafb397c095001 100644 (file)
--- a/src/tee.c
+++ b/src/tee.c
@@ -228,7 +228,7 @@ tee_files (int nfiles, char **files)
 
   while (n_outputs)
     {
-      bytes_read = read (0, buffer, sizeof buffer);
+      bytes_read = read (STDIN_FILENO, buffer, sizeof buffer);
       if (bytes_read < 0 && errno == EINTR)
         continue;
       if (bytes_read <= 0)