From: Werner Koch Date: Mon, 13 Feb 2017 18:38:53 +0000 (+0100) Subject: gpgconf: No ENOENT warning with --change-options et al. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=afe9919be926a9a0dee513664d6a3e995c4202f7;p=gnupg2.git 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 (cherry picked from commit 30dac0486b6357e84fbe79c612eea940b654e4d1) Gbp-Pq: Name 0036-gpgconf-No-ENOENT-warning-with-change-options-et-al.patch --- diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index 180fd65..a0d9659 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -2163,8 +2163,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)