[Pkg-gnupg-commit] [gnupg2] 72/166: gpgconf: No ENOENT warning with --change-options et al.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Mar 16 22:33:07 UTC 2017


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

dkg pushed a commit to branch experimental
in repository gnupg2.

commit 30dac0486b6357e84fbe79c612eea940b654e4d1
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Feb 13 19:38:53 2017 +0100

    gpgconf: No ENOENT warning with --change-options et al.
    
    * tools/gpgconf-comp.c (retrieve_options_from_program): Check ERRNO
    before printing a warning.
    --
    
    It is common that a conf files does not exist - thus we should not
    print a warning.
    
    GnuPG-bug-id: 2944
    
    BTW: The error messages in gpgconf should be reworked to match those
    of the other components.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 tools/gpgconf-comp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
index 20e8411..d1144b2 100644
--- a/tools/gpgconf-comp.c
+++ b/tools/gpgconf-comp.c
@@ -2164,8 +2164,11 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend)
 
   config = es_fopen (config_filename, "r");
   if (!config)
-    gc_error (0, errno, "warning: can not open config file %s",
-	      config_filename);
+    {
+      if (errno != ENOENT)
+        gc_error (0, errno, "warning: can not open config file %s",
+                  config_filename);
+    }
   else
     {
       while ((length = es_read_line (config, &line, &line_len, NULL)) > 0)

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



More information about the Pkg-gnupg-commit mailing list