diff options
author | Werner Koch <[email protected]> | 2003-06-18 19:56:13 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2003-06-18 19:56:13 +0000 |
commit | c0c2c58054923d506f61ce9a71d509b48a381211 (patch) | |
tree | a8f82bffb44eb68eb726ff6db41fa715bcd29193 /g10/dearmor.c | |
parent | A small step for GnuPG but a huge leap for error codes. (diff) | |
download | gnupg-c0c2c58054923d506f61ce9a71d509b48a381211.tar.gz gnupg-c0c2c58054923d506f61ce9a71d509b48a381211.zip |
Finished the bulk of changes for gnupg 1.9. This included switching
to libgcrypt functions, using shared error codes from libgpg-error,
replacing the old functions we used to have in ../util by those in
../jnlib and ../common, renaming the malloc functions and a couple of
types. Note, that not all changes are listed below becuause they are
too similar and done at far too many places. As of today the code
builds using the current libgcrypt from CVS but it is very unlikely
that it actually works.
Diffstat (limited to 'g10/dearmor.c')
-rw-r--r-- | g10/dearmor.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/g10/dearmor.c b/g10/dearmor.c index 4ec8fa012..4f9fa2db7 100644 --- a/g10/dearmor.c +++ b/g10/dearmor.c @@ -1,5 +1,5 @@ /* dearmor.c - Armor utility - * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -25,6 +25,7 @@ #include <errno.h> #include <assert.h> +#include "gpg.h" #include "errors.h" #include "iobuf.h" #include "memory.h" @@ -42,7 +43,7 @@ int dearmor_file( const char *fname ) { armor_filter_context_t afx; - IOBUF inp = NULL, out = NULL; + iobuf_t inp = NULL, out = NULL; int rc = 0; int c; @@ -50,9 +51,9 @@ dearmor_file( const char *fname ) /* prepare iobufs */ if( !(inp = iobuf_open(fname)) ) { + rc = gpg_error_from_errno (errno); log_error("can't open %s: %s\n", fname? fname: "[stdin]", strerror(errno) ); - rc = G10ERR_OPEN_FILE; goto leave; } @@ -84,7 +85,7 @@ int enarmor_file( const char *fname ) { armor_filter_context_t afx; - IOBUF inp = NULL, out = NULL; + iobuf_t inp = NULL, out = NULL; int rc = 0; int c; @@ -92,9 +93,9 @@ enarmor_file( const char *fname ) /* prepare iobufs */ if( !(inp = iobuf_open(fname)) ) { + rc = gpg_error_from_errno (errno); log_error("can't open %s: %s\n", fname? fname: "[stdin]", strerror(errno) ); - rc = G10ERR_OPEN_FILE; goto leave; } |