]> sjero.net Git - wget/commitdiff
trunc: check for `close'-ing the fd errors.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 11 Dec 2011 14:18:11 +0000 (15:18 +0100)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 11 Dec 2011 14:18:11 +0000 (15:18 +0100)
ChangeLog
util/trunc.c

index 7691445e2a51420ce13dd41b12238cfebe2c48a5..150066981ea545745bc9fbf932551c69d89e969b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-11  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * util/trunc.c (main): Call `close' on the fd and check for errors.
+       Reported by: <dga@cs.cmu.edu>.
+
 2011-10-23  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * bootstrap.conf (gnulib_modules): Include module `vsnprintf'.
index 55cb19d3175a0524199643f25ee617ae2fedb739..a5f1dcb07a5157fcd3fc2a740eaad7dba0e2df60 100644 (file)
@@ -128,5 +128,11 @@ main (int argc, char *argv[])
       exit (EXIT_FAILURE);
     }
 
+  if (close (fd) < 0)
+    {
+      perror (PROGRAM_NAME ": close");
+      exit (EXIT_FAILURE);
+    }
+
   return 0;
 }