diff options
author | Werner Koch <wk@gnupg.org> | 2006-09-06 18:35:52 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2006-09-06 18:35:52 +0200 |
commit | eef036df235b7fb16b57bb78daf6f7e590d8e6d6 (patch) | |
tree | 9350e6fa2ffde2219b3b13dabb450c96064ca1ad /tools | |
parent | Minor changes and typo fixes. (diff) | |
download | gnupg2-eef036df235b7fb16b57bb78daf6f7e590d8e6d6.tar.xz gnupg2-eef036df235b7fb16b57bb78daf6f7e590d8e6d6.zip |
The big Assuan error code removal.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ChangeLog | 8 | ||||
-rw-r--r-- | tools/gpg-connect-agent.c | 17 | ||||
-rw-r--r-- | tools/no-libgcrypt.c | 10 |
3 files changed, 22 insertions, 13 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog index af5925aa1..1b8a79345 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -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. diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c index 90e321000..eacbd924f 100644 --- a/tools/gpg-connect-agent.c +++ b/tools/gpg-connect-agent.c @@ -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); } diff --git a/tools/no-libgcrypt.c b/tools/no-libgcrypt.c index 636df10c6..10e88f0e7 100644 --- a/tools/no-libgcrypt.c +++ b/tools/no-libgcrypt.c @@ -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; } |