1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Move cleanup related code to `cleanup'

This commit is contained in:
Giuseppe Scrivano 2012-06-16 12:20:33 +02:00
parent 93720df4c8
commit 90e9d9e1bd
3 changed files with 12 additions and 8 deletions

View File

@ -1,5 +1,8 @@
2012-06-16 Giuseppe Scrivano <gscrivano@gnu.org>
* main.c (main): Move some cleanup related function to...
* init.c (cleanup): ...here.
* main.c: Do not include "stdout.h".
(main): Do not register `close_stdout' at exit.
Reported by: Micah Cowan <micah@cowan.name>.

View File

@ -1675,6 +1675,12 @@ cleanup (void)
{
/* Free external resources, close files, etc. */
/* Close WARC file. */
if (opt.warc_filename != 0)
warc_close ();
log_close ();
if (output_stream)
fclose (output_stream);
/* No need to check for error because Wget flushes its output (and
@ -1696,6 +1702,9 @@ cleanup (void)
host_cleanup ();
log_cleanup ();
for (i = 0; i < nurl; i++)
xfree (url[i]);
{
extern acc_t *netrc_list;
free_netrc (netrc_list);

View File

@ -1626,14 +1626,6 @@ outputting to a regular file.\n"));
if (opt.convert_links && !opt.delete_after)
convert_all_links ();
/* Close WARC file. */
if (opt.warc_filename != 0)
warc_close ();
log_close ();
for (i = 0; i < nurl; i++)
xfree (url[i]);
cleanup ();
exit (get_exit_status ());