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:
parent
93720df4c8
commit
90e9d9e1bd
@ -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>.
|
||||
|
@ -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);
|
||||
|
@ -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 ());
|
||||
|
Loading…
Reference in New Issue
Block a user