X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Finit.c;h=cafd456cd2befc18d89e33bbbdc58600a435eaef;hb=b1838bdfd197ec970d834ce5042995df92516841;hp=40b62b2715c44882603c004c0cb54e9222d55feb;hpb=90e9d9e1bd98dcb1ab286d696acf790cf3758a6a;p=wget diff --git a/src/init.c b/src/init.c index 40b62b27..cafd456c 100644 --- a/src/init.c +++ b/src/init.c @@ -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 #include @@ -66,6 +67,7 @@ as that of the covered work. */ #include "res.h" /* for res_cleanup */ #include "http.h" /* for http_cleanup */ #include "retr.h" /* for output_stream */ +#include "warc.h" /* for warc_close */ #ifdef TESTING #include "test.h" @@ -1667,6 +1669,7 @@ decode_string (const char *val, const struct decode_item *items, int itemcount, void cleanup_html_url (void); +void spider_cleanup (void); /* Free the memory allocated by global variables. */ @@ -1682,7 +1685,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. */ @@ -1699,6 +1704,7 @@ cleanup (void) res_cleanup (); http_cleanup (); cleanup_html_url (); + spider_cleanup (); host_cleanup (); log_cleanup ();