This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

commit 88d4da0a6c8ae18ddce08cee27c16abb72f8c454
Author: Guillem Jover <[email protected]>
Date:   Sun Mar 25 15:12:57 2018 +0200

    dselect: Fix assert() to expect methlockfd to be initialized
    
    The assert should be checking whether the method lock fd has been
    initialized, not whether it's not zero, which happens to be the case
    with the default uninitialized -1 value.
---
 debian/changelog  | 2 ++
 dselect/method.cc | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 6581484..fcaa528 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -40,6 +40,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium
     Reported by Heinz Repp <[email protected]>. Closes: #888983
   * Switch a DEBIAN/conffile parsing assert() in dpkg due to empty lines
     into an ohshit(), because this is really a run-time error.
+  * Fix assert() in dselect to expect the method lock file descriptor to be
+    initialized, instead of non-zero.
   * Architecture support:
     - Add support for riscv64 CPU. Closes: #822914
       Thanks to Manuel A. Fernandez Montecelo <[email protected]>
diff --git a/dselect/method.cc b/dselect/method.cc
index ef5c4c3..74ac984 100644
--- a/dselect/method.cc
+++ b/dselect/method.cc
@@ -72,7 +72,7 @@ static void cu_unlockmethod(int, void**) {
   struct flock fl;
 
   assert(methodlockfile);
-  assert(methlockfd);
+  assert(methlockfd >= 0);
   fl.l_type=F_UNLCK; fl.l_whence= SEEK_SET; fl.l_start=fl.l_len=0;
   if (fcntl(methlockfd,F_SETLK,&fl) == -1)
     sthfailed(_("cannot unlock access method area"));

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/dpkg/dpkg.git

Reply via email to