From f3251023750d6bd9023dbb8373c804d7d4540a56 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 3 Jun 2019 16:31:58 +0200 Subject: Return better error code for some getinfo IPC commands. * agent/command.c (cmd_getinfo): Return GPG_ERR_FALSE as boolean False. * g13/server.c (cmd_getinfo): Ditto. * sm/server.c (cmd_getinfo): Ditto. -- GPG_ERR_FALSE was introduced with libgpg-error 1.21 and we now require a later version for gnupg 2. Thus we can switch to this more descriptive code. Signed-off-by: Werner Koch --- sm/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sm/server.c') diff --git a/sm/server.c b/sm/server.c index 98505e26d..77ec07fc0 100644 --- a/sm/server.c +++ b/sm/server.c @@ -1162,14 +1162,14 @@ cmd_getinfo (assuan_context_t ctx, char *line) { cmdopt = line; if (!command_has_option (cmd, cmdopt)) - rc = gpg_error (GPG_ERR_GENERAL); + rc = gpg_error (GPG_ERR_FALSE); } } } } else if (!strcmp (line, "offline")) { - rc = ctrl->offline? 0 : gpg_error (GPG_ERR_GENERAL); + rc = ctrl->offline? 0 : gpg_error (GPG_ERR_FALSE); } else rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT"); -- cgit v1.2.3