[git] GnuPG - branch, master, updated. gnupg-2.1.21-17-gde3a098

by Werner Koch cvs at cvs.gnupg.org
Thu May 25 20:31:11 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  de3a0988ef9addccd6b5c7950fb8797afbc3978d (commit)
      from  b5f356e9fba2d99909f8f54d7b7e6836bed87b68 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit de3a0988ef9addccd6b5c7950fb8797afbc3978d
Author: Werner Koch <wk at gnupg.org>
Date:   Thu May 25 20:26:54 2017 +0200

    dirmngr: This towel should better detect a changed resolv.conf.
    
    * dirmngr/dns-stuff.c (resolv_conf_changed_p): Fix initialization time
    issue.
    --
    
    Fixes-commit: b5f356e9fba2d99909f8f54d7b7e6836bed87b68
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index a8ddbc6..7324aae 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -407,21 +407,23 @@ resolv_conf_changed_p (void)
   static time_t last_mtime;
   const char *fname = RESOLV_CONF_NAME;
   struct stat statbuf;
-  int changed;
+  int changed = 0;
 
   if (stat (fname, &statbuf))
     {
       log_error ("stat'ing '%s' failed: %s\n",
                  fname, gpg_strerror (gpg_error_from_syserror ()));
-      changed = 0;
       last_mtime = 1; /* Force a "changed" result the next time stat
                        * works.  */
     }
-  else
+  else if (!last_mtime)
+    last_mtime = statbuf.st_mtime;
+  else if (last_mtime != statbuf.st_mtime)
     {
-      changed = last_mtime && (last_mtime != statbuf.st_mtime);
+      changed = 1;
       last_mtime = statbuf.st_mtime;
     }
+
   return changed;
 #endif
 }

-----------------------------------------------------------------------

Summary of changes:
 dirmngr/dns-stuff.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list