]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tee: close "-" file
authorBernhard Voelker <mail@bernhard-voelker.de>
Mon, 23 Feb 2015 00:57:37 +0000 (01:57 +0100)
committerBernhard Voelker <mail@bernhard-voelker.de>
Mon, 23 Feb 2015 10:39:08 +0000 (11:39 +0100)
This is a cleanup to the previous commit v8.23-138-g7ceaf1d.

* src/tee.c (tee_files): Do not exempt the "-" file from being closed,
as this is no longer stdout but a normal file.

src/tee.c

index feb4026286f3727f260c1ceacaaf2d5ee37227aa..27bd2a45d943724d0a49cc726844286234ef5d4d 100644 (file)
--- a/src/tee.c
+++ b/src/tee.c
@@ -213,8 +213,7 @@ tee_files (int nfiles, const char **files)
 
   /* Close the files, but not standard output.  */
   for (i = 1; i <= nfiles; i++)
-    if (!STREQ (files[i], "-")
-        && descriptors[i] && fclose (descriptors[i]) != 0)
+    if (descriptors[i] && fclose (descriptors[i]) != 0)
       {
         error (0, errno, "%s", files[i]);
         ok = false;