mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Take advantage of newer gpg-error features.
This commit is contained in:
parent
9577dd45ab
commit
03d3322e5f
55 changed files with 297 additions and 260 deletions
12
g10/tdbio.c
12
g10/tdbio.c
|
@ -126,14 +126,14 @@ write_cache_item( CACHE_CTRL r )
|
|||
int n;
|
||||
|
||||
if( lseek( db_fd, r->recno * TRUST_RECORD_LEN, SEEK_SET ) == -1 ) {
|
||||
err = gpg_error_from_errno (errno);
|
||||
err = gpg_error_from_syserror ();
|
||||
log_error(_("trustdb rec %lu: lseek failed: %s\n"),
|
||||
r->recno, strerror(errno) );
|
||||
return err;
|
||||
}
|
||||
n = write( db_fd, r->data, TRUST_RECORD_LEN);
|
||||
if( n != TRUST_RECORD_LEN ) {
|
||||
err = gpg_error_from_errno (errno);
|
||||
err = gpg_error_from_syserror ();
|
||||
log_error(_("trustdb rec %lu: write failed (n=%d): %s\n"),
|
||||
r->recno, n, strerror(errno) );
|
||||
return err;
|
||||
|
@ -1162,7 +1162,7 @@ tdbio_read_record( ulong recnum, TRUSTREC *rec, int expected )
|
|||
buf = get_record_from_cache( recnum );
|
||||
if( !buf ) {
|
||||
if( lseek( db_fd, recnum * TRUST_RECORD_LEN, SEEK_SET ) == -1 ) {
|
||||
err = gpg_error_from_errno (errno);
|
||||
err = gpg_error_from_syserror ();
|
||||
log_error(_("trustdb: lseek failed: %s\n"), strerror(errno) );
|
||||
return err;
|
||||
}
|
||||
|
@ -1171,7 +1171,7 @@ tdbio_read_record( ulong recnum, TRUSTREC *rec, int expected )
|
|||
return -1; /* eof */
|
||||
}
|
||||
else if( n != TRUST_RECORD_LEN ) {
|
||||
err = gpg_error_from_errno (errno);
|
||||
err = gpg_error_from_syserror ();
|
||||
log_error(_("trustdb: read failed (n=%d): %s\n"), n,
|
||||
strerror(errno) );
|
||||
return err;
|
||||
|
@ -1435,14 +1435,14 @@ tdbio_new_recnum()
|
|||
rec.recnum = recnum;
|
||||
rc = 0;
|
||||
if( lseek( db_fd, recnum * TRUST_RECORD_LEN, SEEK_SET ) == -1 ) {
|
||||
rc = gpg_error_from_errno (errno);
|
||||
rc = gpg_error_from_syserror ();
|
||||
log_error(_("trustdb rec %lu: lseek failed: %s\n"),
|
||||
recnum, strerror(errno) );
|
||||
}
|
||||
else {
|
||||
int n = write( db_fd, &rec, TRUST_RECORD_LEN);
|
||||
if( n != TRUST_RECORD_LEN ) {
|
||||
rc = gpg_error_from_errno (errno);
|
||||
rc = gpg_error_from_syserror ();
|
||||
log_error(_("trustdb rec %lu: write failed (n=%d): %s\n"),
|
||||
recnum, n, strerror(errno) );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue