From 04f29f2f08da21cbcebbf86fe98de0522f024c64 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 26 Feb 2012 02:41:07 +0100 Subject: [PATCH] Report stdout close errors. --- ChangeLog | 4 ++++ NEWS | 4 +++- bootstrap.conf | 3 ++- src/ChangeLog | 5 +++++ src/main.c | 6 ++++-- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a391a786..39cfd525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-02-26 Giuseppe Scrivano + + * bootstrap.conf (gnulib_modules): Add module `closeout'. + 2012-01-09 Gijs van Tulder * configure.ac: Always try to use libz, even without SSL. diff --git a/NEWS b/NEWS index 3a6aca0d..5c8184b4 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ GNU Wget NEWS -- history of user-visible changes. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. See the end for copying conditions. Please send GNU Wget bug reports to . @@ -18,6 +18,8 @@ Please send GNU Wget bug reports to . ** Autoreconf works again for distributed tarballs. ** Print some diagnostic messages to stderr not to stdout. + +** Report stdout close errors. * Changes in Wget 1.13.4 diff --git a/bootstrap.conf b/bootstrap.conf index 6473cbba..fff26a6d 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -1,5 +1,5 @@ # bootstrap.conf - Bootstrap configuration. -# Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, # Inc. # # This file is part of GNU Wget. @@ -33,6 +33,7 @@ bind c-ctype clock-time close +closeout connect fcntl futimens diff --git a/src/ChangeLog b/src/ChangeLog index 9f221012..caebc5e4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-02-26 Giuseppe Scrivano + + * main.c: Include "closeout.h" + (main): Register close_stdout at exit. + 2012-02-01 Gijs van Tulder * warc.c: Fix large file support with ftello, fseeko. diff --git a/src/main.c b/src/main.c index 352715a0..3e731e9d 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,6 @@ /* Command line parsing. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, + 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GNU Wget. @@ -56,7 +56,7 @@ as that of the covered work. */ #include "http.h" /* for save_cookies */ #include "ptimer.h" #include "warc.h" - +#include "closeout.h" #include #include #include @@ -966,6 +966,8 @@ main (int argc, char **argv) i18n_initialize (); + atexit (close_stdout); + /* Construct the name of the executable, without the directory part. */ #ifdef __VMS /* On VMS, lose the "dev:[dir]" prefix and the ".EXE;nnn" suffix. */ -- 2.39.2