diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 6 | ||||
-rw-r--r-- | common/Makefile.am | 1 | ||||
-rw-r--r-- | common/asshelp.c | 5 | ||||
-rw-r--r-- | common/maperror.c | 3 | ||||
-rw-r--r-- | common/util.h | 18 |
5 files changed, 22 insertions, 11 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index 6cd136c5d..7a917fdd7 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,9 @@ +2006-09-06 Werner Koch <[email protected]> + + * maperror.c: Removed. + + * util.h (out_of_core): New. + 2006-09-04 Werner Koch <[email protected]> * http.c (http_get_header): New. diff --git a/common/Makefile.am b/common/Makefile.am index 9bdc8dce6..d6143de67 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -34,7 +34,6 @@ libcommon_a_SOURCES = \ keyserver.h \ sexp-parse.h \ sexputil.c \ - maperror.c \ sysutils.c sysutils.h \ homedir.c \ gettime.c \ diff --git a/common/asshelp.c b/common/asshelp.c index 1da899522..3b46b5ed3 100644 --- a/common/asshelp.c +++ b/common/asshelp.c @@ -47,10 +47,7 @@ send_one_option (assuan_context_t ctx, gpg_err_source_t errsource, err = gpg_error_from_errno (errno); else { - assuan_error_t ae; - - ae = assuan_transact (ctx, optstr, NULL, NULL, NULL, NULL, NULL, NULL); - err = ae? map_assuan_err_with_source (errsource, ae) : 0; + err = assuan_transact (ctx, optstr, NULL, NULL, NULL, NULL, NULL, NULL); free (optstr); } diff --git a/common/maperror.c b/common/maperror.c index 06546b501..f0f11c4fa 100644 --- a/common/maperror.c +++ b/common/maperror.c @@ -19,6 +19,8 @@ * USA. */ +#error This file is not anymore used. + #include <config.h> #include <errno.h> #include <stdio.h> @@ -33,6 +35,7 @@ #include "errors.h" + /* Map Assuan error code ERR to an GPG_ERR_ code. We need to distinguish between genuine (and legacy) Assuan error codes and application error codes shared with all GnuPG modules. The rule is diff --git a/common/util.h b/common/util.h index 29106bf9c..10828d7e5 100644 --- a/common/util.h +++ b/common/util.h @@ -24,7 +24,8 @@ #include <gcrypt.h> /* We need this for the memory function protos. */ #include <time.h> /* We need time_t. */ -#include <gpg-error.h> /* we need gpg-error_t. */ +#include <errno.h> /* We need errno. */ +#include <gpg-error.h> /* We need gpg_error_t. */ /* Common GNUlib includes (-I ../gl/). */ #include "strpbrk.h" @@ -64,17 +65,22 @@ #define xmalloc_clear(a) gcry_xcalloc (1, (a)) #define xmalloc_secure_clear(a) gcry_xcalloc_secure (1, (a)) +/* Convenience function to return a gpg-error code for memory + allocation failures. This function makes sure that an error will + be returned even if accidently ERRNO is not set. */ +static inline gpg_error_t +out_of_core (void) +{ + return gpg_error (errno + ? gpg_err_code_from_errno(errno) + : GPG_ERR_MISSING_ERRNO); +} /* A type to hold the ISO time. Note that this this is the same as the the KSBA type ksba_isotime_t. */ typedef char gnupg_isotime_t[16]; -/*-- maperror.c --*/ -int map_kbx_err (int err); -gpg_error_t map_assuan_err_with_source (int source, int err); -int map_to_assuan_status (int rc); - /*-- gettime.c --*/ time_t gnupg_get_time (void); void gnupg_get_isotime (gnupg_isotime_t timebuf); |