aboutsummaryrefslogtreecommitdiffstats
path: root/g10/compress.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2006-08-01 12:23:34 +0000
committerWerner Koch <[email protected]>2006-08-01 12:23:34 +0000
commit8c219602515ae1dba5bc0da31077852dab61809e (patch)
tree49d596d702cfec2b8cc42ccaf8c90c82d5200ac5 /g10/compress.c
parentForgot this one. (diff)
parent2006-07-29 Marcus Brinkmann <[email protected]> (diff)
downloadgnupg-8c219602515ae1dba5bc0da31077852dab61809e.tar.gz
gnupg-8c219602515ae1dba5bc0da31077852dab61809e.zip
Moved 1.9 branch to trunk
Diffstat (limited to 'g10/compress.c')
-rw-r--r--g10/compress.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/g10/compress.c b/g10/compress.c
index 0cee5ae54..030a4c1d1 100644
--- a/g10/compress.c
+++ b/g10/compress.c
@@ -1,6 +1,6 @@
/* compress.c - compress filter
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
- * 2003 Free Software Foundation, Inc.
+ * 2003, 2006 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -36,10 +36,10 @@
#include <zlib.h>
#if defined(__riscos__) && defined(USE_ZLIBRISCOS)
# include "zlib-riscos.h"
-#endif
+#endif
+#include "gpg.h"
#include "util.h"
-#include "memory.h"
#include "packet.h"
#include "filter.h"
#include "main.h"
@@ -87,6 +87,7 @@ init_compress( compress_filter_context_t *zfx, z_stream *zs )
static int
do_compress( compress_filter_context_t *zfx, z_stream *zs, int flush, IOBUF a )
{
+ int rc;
int zrc;
unsigned n;
@@ -116,9 +117,9 @@ do_compress( compress_filter_context_t *zfx, z_stream *zs, int flush, IOBUF a )
(unsigned)zs->avail_in, (unsigned)zs->avail_out,
(unsigned)n, zrc );
- if( iobuf_write( a, zfx->outbuf, n ) ) {
+ if( (rc=iobuf_write( a, zfx->outbuf, n )) ) {
log_debug("deflate: iobuf_write failed\n");
- return G10ERR_WRITE_FILE;
+ return rc;
}
} while( zs->avail_in || (flush == Z_FINISH && zrc != Z_STREAM_END) );
return 0;