]> sjero.net Git - wget/blobdiff - src/init.c
Check for fclose errors.
[wget] / src / init.c
index 40b62b2715c44882603c004c0cb54e9222d55feb..4188ca16c1b66795f896baa771a6caa836af2437 100644 (file)
@@ -30,6 +30,7 @@ shall include the source code for the parts of OpenSSL used as well
 as that of the covered work.  */
 
 #include "wget.h"
+#include "exits.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -1682,7 +1683,9 @@ cleanup (void)
   log_close ();
 
   if (output_stream)
-    fclose (output_stream);
+    if (fclose (output_stream) == EOF)
+      inform_exit_status (CLOSEFAILED);
+
   /* No need to check for error because Wget flushes its output (and
      checks for errors) after any data arrives.  */