The following commit has been merged in the master branch:
commit d30fdccff56e8ed63e81e7e114c421d5c806d8e7
Author: Guillem Jover <guil...@debian.org>
Date:   Fri Nov 21 16:46:30 2008 +0200

    libdpkg: Do not try to close already closed files

diff --git a/debian/changelog b/debian/changelog
index a0866d7..3566257 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ dpkg (1.15.3) UNRELEASED; urgency=low
   * Use default compressor values in dpkg-source from Dpkg::Source::Compressor.
   * Fix dpkg-scanpackages to properly detect spurious overrides.
   * Rewrite dpkg-name in perl.
+  * Do not close already closed files in some error conditions in libdpkg.
 
   [ Raphael Hertzog ]
   * Unset TAR_OPTIONS when creating/extracting tar archives for source
diff --git a/lib/triglib.c b/lib/triglib.c
index 3a135d2..b9344b0 100644
--- a/lib/triglib.c
+++ b/lib/triglib.c
@@ -404,10 +404,14 @@ trk_explicit_interest_change(const char *trig,  struct 
pkginfo *pkg, int signum)
        }
        if (signum > 0)
                fprintf(nf, "%s\n", pkg->name);
-       if (ferror(nf) || fclose(nf))
+
+       if (ferror(nf))
                ohshite(_("unable to write new trigger interest file `%.250s'"),
                        newfn.buf);
        pop_cleanup(ehflag_normaltidy);
+       if (fclose(nf))
+               ohshite(_("unable to close new trigger interest file `%.250s'"),
+                       newfn.buf);
 
        if (rename(newfn.buf, trk_explicit_fn.buf))
                ohshite(_("unable to install new trigger interest file 
`%.250s'"),
@@ -498,10 +502,13 @@ trig_file_interests_save(void)
                fprintf(nf, "%s %s\n", trigh.namenode_name(tfi->fnn),
                        tfi->pkg->name);
 
-       if (ferror(nf) || fclose(nf))
+       if (ferror(nf))
                ohshite(_("unable to write new file triggers file `%.250s'"),
                        triggersnewfilefile);
        pop_cleanup(ehflag_normaltidy);
+       if (fclose(nf))
+               ohshite(_("unable to close new file triggers file `%.250s'"),
+                       triggersnewfilefile);
 
        if (rename(triggersnewfilefile, triggersfilefile))
                ohshite(_("unable to install new file triggers file as 
`%.250s'"),

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to