mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
The big Assuan error code removal.
This commit is contained in:
parent
7b9fa9da99
commit
eef036df23
54 changed files with 671 additions and 603 deletions
|
@ -1,3 +1,11 @@
|
|||
2006-09-06 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpg-connect-agent.c: Switch everything to new Assuan error code
|
||||
style.
|
||||
|
||||
* no-libgcrypt.c (out_of_core): Reanmed to ...
|
||||
(out_of_memory): .. this to avoid name clash with util.h.
|
||||
|
||||
2006-08-21 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgsplit.c: New. Taken from 1.4. Adjusted to GnuPG2.
|
||||
|
|
|
@ -224,6 +224,7 @@ main (int argc, char **argv)
|
|||
|
||||
set_strusage (my_strusage);
|
||||
log_set_prefix ("gpg-connect-agent", 1);
|
||||
assuan_set_assuan_err_source (0);
|
||||
|
||||
i18n_init();
|
||||
|
||||
|
@ -259,7 +260,7 @@ main (int argc, char **argv)
|
|||
if (rc)
|
||||
{
|
||||
log_error ("can't connect to socket `%s': %s\n",
|
||||
opt.raw_socket, assuan_strerror (rc));
|
||||
opt.raw_socket, gpg_strerror (rc));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
@ -347,7 +348,7 @@ main (int argc, char **argv)
|
|||
rc = assuan_write_line (ctx, line);
|
||||
if (rc)
|
||||
{
|
||||
log_info (_("sending line failed: %s\n"), assuan_strerror (rc) );
|
||||
log_info (_("sending line failed: %s\n"), gpg_strerror (rc) );
|
||||
continue;
|
||||
}
|
||||
if (*line == '#' || !*line)
|
||||
|
@ -355,7 +356,7 @@ main (int argc, char **argv)
|
|||
|
||||
rc = read_and_print_response (ctx);
|
||||
if (rc)
|
||||
log_info (_("receiving line failed: %s\n"), assuan_strerror (rc) );
|
||||
log_info (_("receiving line failed: %s\n"), gpg_strerror (rc) );
|
||||
}
|
||||
|
||||
if (opt.verbose)
|
||||
|
@ -431,7 +432,7 @@ handle_inquire (assuan_context_t ctx, char *line)
|
|||
rc = assuan_send_data (ctx, buffer, n);
|
||||
if (rc)
|
||||
{
|
||||
log_error ("sending data back failed: %s\n", assuan_strerror (rc) );
|
||||
log_error ("sending data back failed: %s\n", gpg_strerror (rc) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -440,7 +441,7 @@ handle_inquire (assuan_context_t ctx, char *line)
|
|||
|
||||
rc = assuan_send_data (ctx, NULL, 0);
|
||||
if (rc)
|
||||
log_error ("sending data back failed: %s\n", assuan_strerror (rc) );
|
||||
log_error ("sending data back failed: %s\n", gpg_strerror (rc) );
|
||||
|
||||
if (d->is_prog)
|
||||
{
|
||||
|
@ -556,7 +557,7 @@ read_and_print_response (assuan_context_t ctx)
|
|||
/* Received from server, thus more responses are expected. */
|
||||
}
|
||||
else
|
||||
return ASSUAN_Invalid_Response;
|
||||
return gpg_error (GPG_ERR_ASS_INV_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -612,7 +613,7 @@ start_agent (void)
|
|||
|
||||
if (rc)
|
||||
{
|
||||
log_error ("can't connect to the agent: %s\n", assuan_strerror (rc));
|
||||
log_error ("can't connect to the agent: %s\n", gpg_strerror (rc));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
@ -623,7 +624,7 @@ start_agent (void)
|
|||
if (rc)
|
||||
{
|
||||
log_error (_("error sending %s command: %s\n"), "RESET",
|
||||
assuan_strerror (rc));
|
||||
gpg_strerror (rc));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
../jnlib/libjnlib.a . ../common/util.h defines macros to map them
|
||||
to xmalloc etc. */
|
||||
static void
|
||||
out_of_core (void)
|
||||
out_of_memory (void)
|
||||
{
|
||||
log_fatal (_("error allocating enough memory: %s\n"), strerror (errno));
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ gcry_xmalloc (size_t n)
|
|||
{
|
||||
void *p = malloc (n);
|
||||
if (!p)
|
||||
out_of_core ();
|
||||
out_of_memory ();
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ gcry_xrealloc (void *a, size_t n)
|
|||
{
|
||||
void *p = realloc (a, n);
|
||||
if (!p)
|
||||
out_of_core ();
|
||||
out_of_memory ();
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ gcry_xcalloc (size_t n, size_t m)
|
|||
{
|
||||
void *p = calloc (n, m);
|
||||
if (!p)
|
||||
out_of_core ();
|
||||
out_of_memory ();
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ gcry_xstrdup (const char *string)
|
|||
{
|
||||
void *p = malloc (strlen (string)+1);
|
||||
if (!p)
|
||||
out_of_core ();
|
||||
out_of_memory ();
|
||||
strcpy( p, string );
|
||||
return p;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue