summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-10-08 04:02:00 +0000
committerJim Meyering <jim@meyering.net>1995-10-08 04:02:00 +0000
commit06ea91f2f332b2041bb598c3a41c10dd9fb3d39f (patch)
tree1668f03c9df84ed3cac63f6622b7176e05a01a9c /src
parent3c7699600f242ae69e2391ea2c048506e50ccbaf (diff)
downloadcoreutils-06ea91f2f332b2041bb598c3a41c10dd9fb3d39f.tar.xz
(main): Close input files.
Diffstat (limited to 'src')
-rw-r--r--src/join.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/join.c b/src/join.c
index d26b25635..14a3b7a30 100644
--- a/src/join.c
+++ b/src/join.c
@@ -815,6 +815,10 @@ main (int argc, char **argv)
error (1, errno, _("both files cannot be standard input"));
join (fp1, fp2);
+ if (fp1 != stdin && fclose (fp1) == EOF)
+ error (1, errno, "%s", names[0]);
+ if (fp2 != stdin && fclose (fp2) == EOF)
+ error (1, errno, "%s", names[1]);
if ((fp1 == stdin || fp2 == stdin) && fclose (stdin) == EOF)
error (1, errno, "-");
if (ferror (stdout) || fclose (stdout) == EOF)