summaryrefslogtreecommitdiffstats
path: root/g10/tdbdump.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2003-06-18 21:56:13 +0200
committerWerner Koch <wk@gnupg.org>2003-06-18 21:56:13 +0200
commitc0c2c58054923d506f61ce9a71d509b48a381211 (patch)
treea8f82bffb44eb68eb726ff6db41fa715bcd29193 /g10/tdbdump.c
parentA small step for GnuPG but a huge leap for error codes. (diff)
downloadgnupg2-c0c2c58054923d506f61ce9a71d509b48a381211.tar.xz
gnupg2-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/tdbdump.c')
-rw-r--r--g10/tdbdump.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/g10/tdbdump.c b/g10/tdbdump.c
index cd46f1f5a..3f9e8b388 100644
--- a/g10/tdbdump.c
+++ b/g10/tdbdump.c
@@ -1,5 +1,5 @@
/* tdbdump.c
- * 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.
*
@@ -30,6 +30,7 @@
#include <fcntl.h>
#include <unistd.h>
+#include "gpg.h"
#include "errors.h"
#include "iobuf.h"
#include "keydb.h"
@@ -57,7 +58,7 @@ write_record( TRUSTREC *rec )
if( !rc )
return;
log_error(_("trust record %lu, type %d: write failed: %s\n"),
- rec->recnum, rec->rectype, g10_errstr(rc) );
+ rec->recnum, rec->rectype, gpg_strerror (rc) );
tdbio_invalid();
}
@@ -137,7 +138,7 @@ import_ownertrust( const char *fname )
is_stdin = 1;
}
else if( !(fp = fopen( fname, "r" )) ) {
- log_error_f(fname, _("can't open file: %s\n"), strerror(errno) );
+ log_error ( _("can't open `%s': %s\n"), fname, strerror(errno) );
return;
}
@@ -148,7 +149,7 @@ import_ownertrust( const char *fname )
continue;
n = strlen(line);
if( line[n-1] != '\n' ) {
- log_error_f(fname, _("line too long\n") );
+ log_error (_("\b%s: line too long\n"), fname );
/* ... or last line does not have a LF */
break; /* can't continue */
}
@@ -156,16 +157,16 @@ import_ownertrust( const char *fname )
if( !isxdigit(*p) )
break;
if( *p != ':' ) {
- log_error_f(fname, _("error: missing colon\n") );
+ log_error (_("\b%s: error: missing colon\n"), fname );
continue;
}
fprlen = p - line;
if( fprlen != 32 && fprlen != 40 ) {
- log_error_f(fname, _("error: invalid fingerprint\n") );
+ log_error (_("\b%s: error: invalid fingerprint\n"), fname );
continue;
}
if( sscanf(p, ":%u:", &otrust ) != 1 ) {
- log_error_f(fname, _("error: no ownertrust value\n") );
+ log_error (_("\b%s: error: no ownertrust value\n"), fname );
continue;
}
if( !otrust )
@@ -201,11 +202,11 @@ import_ownertrust( const char *fname )
any = 1;
}
else /* error */
- log_error_f(fname, _("error finding trust record: %s\n"),
- g10_errstr(rc));
+ log_error (_("\b%s: error finding trust record: %s\n"),
+ fname, gpg_strerror (rc));
}
if( ferror(fp) )
- log_error_f(fname, _("read error: %s\n"), strerror(errno) );
+ log_error (_("\b%s: read error: %s\n"), fname, strerror(errno) );
if( !is_stdin )
fclose(fp);
@@ -214,7 +215,7 @@ import_ownertrust( const char *fname )
revalidation_mark ();
rc = tdbio_sync ();
if (rc)
- log_error (_("trustdb: sync failed: %s\n"), g10_errstr(rc) );
+ log_error (_("trustdb: sync failed: %s\n"), gpg_strerror (rc) );
}
}