1 From: Werner Koch <wk@gnupg.org>
2 Date: Mon, 13 Feb 2017 19:38:53 +0100
3 Subject: gpgconf: No ENOENT warning with --change-options et al.
5 * tools/gpgconf-comp.c (retrieve_options_from_program): Check ERRNO
6 before printing a warning.
9 It is common that a conf files does not exist - thus we should not
14 BTW: The error messages in gpgconf should be reworked to match those
15 of the other components.
17 Signed-off-by: Werner Koch <wk@gnupg.org>
18 (cherry picked from commit 30dac0486b6357e84fbe79c612eea940b654e4d1)
20 tools/gpgconf-comp.c | 7 +++++--
21 1 file changed, 5 insertions(+), 2 deletions(-)
23 diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
24 index 180fd65..a0d9659 100644
25 --- a/tools/gpgconf-comp.c
26 +++ b/tools/gpgconf-comp.c
27 @@ -2163,8 +2163,11 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend)
29 config = es_fopen (config_filename, "r");
31 - gc_error (0, errno, "warning: can not open config file %s",
34 + if (errno != ENOENT)
35 + gc_error (0, errno, "warning: can not open config file %s",
40 while ((length = es_read_line (config, &line, &line_len, NULL)) > 0)