Преглед изворни кода

dpkg-mergechangelogs: fail if it cannot close the output file

Made dpkg-mergechangelogs check the return value of close and fail
if it was not successful.  Previously dpkg-mergechangelogs would
silently fail to write a file if (e.g.) the device was full.

Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
Niels Thykier пре 15 година
родитељ
комит
64dc71b84f
2 измењених фајлова са 3 додато и 1 уклоњено
  1. 2 0
      debian/changelog
  2. 1 1
      scripts/dpkg-mergechangelogs.pl

+ 2 - 0
debian/changelog

@@ -71,6 +71,8 @@ dpkg (1.16.1) UNRELEASED; urgency=low
     flags.
   * Add new --dump action to dpkg-buildflags and make it the default action.
     Closes: #603435
+  * dpkg-mergechangelogs now checks the return value of the close() call.
+    Thanks to Niels Thykier <niels@thykier.net> for the patch. Closes: #633539
 
   [ Guillem Jover ]
   * Install deb-src-control(5) man pages in dpkg-dev. Closes: #620520

+ 1 - 1
scripts/dpkg-mergechangelogs.pl

@@ -128,7 +128,7 @@ while (1) {
 if (defined($out_file) and $out_file ne "-") {
     open(OUT, ">", $out_file) || syserr(_g("cannot write %s"), $out_file);
     print OUT ((blessed $_) ? "$_" : "$_\n") foreach @result;
-    close(OUT);
+    close(OUT) || syserr(_g("cannot write %s"), $out_file);
 } else {
     print ((blessed $_) ? "$_" : "$_\n") foreach @result;
 }