summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)