mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Let --fetch-key return an exit code on failure.
* g10/keyserver.c (keyserver_fetch): Return an error code. * g10/gpg.c (main) <aFetchKeys>: Return 1 in case of no data. -- GnuPG-bug-id: 5376
This commit is contained in:
parent
b90c55fa66
commit
5fe4b97887
2 changed files with 20 additions and 4 deletions
|
@ -4699,12 +4699,14 @@ main (int argc, char **argv)
|
|||
for( ; argc; argc--, argv++ )
|
||||
append_to_strlist2( &sl, *argv, utf8_strings );
|
||||
rc = keyserver_fetch (ctrl, sl, opt.key_origin);
|
||||
free_strlist (sl);
|
||||
if(rc)
|
||||
{
|
||||
write_status_failure ("fetch-keys", rc);
|
||||
log_error ("key fetch failed: %s\n",gpg_strerror (rc));
|
||||
if (gpg_err_code (rc) == GPG_ERR_NO_DATA)
|
||||
g10_exit (1); /* In this case return 1 and not 2. */
|
||||
}
|
||||
free_strlist(sl);
|
||||
break;
|
||||
|
||||
case aExportSecret:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue