aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/call-agent.c16
-rw-r--r--g10/dearmor.c4
-rw-r--r--g10/decrypt.c2
-rw-r--r--g10/encode.c4
-rw-r--r--g10/exec.c8
-rw-r--r--g10/gpg.c2
-rw-r--r--g10/keydb.c4
-rw-r--r--g10/keygen.c2
-rw-r--r--g10/keyring.c26
-rw-r--r--g10/keyserver.c2
-rw-r--r--g10/openfile.c4
-rw-r--r--g10/plaintext.c24
-rw-r--r--g10/sign.c12
-rw-r--r--g10/tdbio.c12
-rw-r--r--g10/verify.c4
16 files changed, 68 insertions, 63 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 99d73a6b7..e2ddb3f4e 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-14 Werner Koch <[email protected]>
+
+ Replaced all call gpg_error_from_errno(errno) by
+ gpg_error_from_syserror().
+
2006-09-13 Werner Koch <[email protected]>
* gpg.c (main): Made --require-cross-certification the default.
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 14218f83c..e26f290d9 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -104,7 +104,7 @@ start_agent (void)
if (fflush (NULL))
{
- gpg_error_t tmperr = gpg_error_from_errno (errno);
+ gpg_error_t tmperr = gpg_error_from_syserror ();
log_error ("error flushing pending output: %s\n", strerror (errno));
return tmperr;
}
@@ -191,7 +191,7 @@ start_agent (void)
char *optstr;
if (asprintf (&optstr, "OPTION display=%s",
opt.display ? opt.display : dft_display) < 0)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
rc = assuan_transact (agent_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
NULL);
free (optstr);
@@ -209,7 +209,7 @@ start_agent (void)
char *optstr;
if (asprintf (&optstr, "OPTION ttyname=%s",
opt.ttyname ? opt.ttyname : dft_ttyname) < 0)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
rc = assuan_transact (agent_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
NULL);
free (optstr);
@@ -222,7 +222,7 @@ start_agent (void)
char *optstr;
if (asprintf (&optstr, "OPTION ttytype=%s",
opt.ttyname ? opt.ttytype : dft_ttytype) < 0)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
rc = assuan_transact (agent_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
NULL);
free (optstr);
@@ -235,7 +235,7 @@ start_agent (void)
{
old_lc = strdup (old_lc);
if (!old_lc)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
}
dft_lc = setlocale (LC_CTYPE, "");
@@ -245,7 +245,7 @@ start_agent (void)
char *optstr;
if (asprintf (&optstr, "OPTION lc-ctype=%s",
opt.lc_ctype ? opt.lc_ctype : dft_lc) < 0)
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
else
{
rc = assuan_transact (agent_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
@@ -268,7 +268,7 @@ start_agent (void)
{
old_lc = strdup (old_lc);
if (!old_lc)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
}
dft_lc = setlocale (LC_MESSAGES, "");
#endif
@@ -277,7 +277,7 @@ start_agent (void)
char *optstr;
if (asprintf (&optstr, "OPTION lc-messages=%s",
opt.lc_messages ? opt.lc_messages : dft_lc) < 0)
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
else
{
rc = assuan_transact (agent_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
diff --git a/g10/dearmor.c b/g10/dearmor.c
index 7f69a1bba..ae89e8e58 100644
--- a/g10/dearmor.c
+++ b/g10/dearmor.c
@@ -58,7 +58,7 @@ dearmor_file( const char *fname )
errno = EPERM;
}
if (!inp) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"), fname? fname: "[stdin]",
strerror(errno) );
goto leave;
@@ -107,7 +107,7 @@ enarmor_file( const char *fname )
errno = EPERM;
}
if (!inp) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"), fname? fname: "[stdin]",
strerror(errno) );
goto leave;
diff --git a/g10/decrypt.c b/g10/decrypt.c
index 9a37283c1..39071427a 100644
--- a/g10/decrypt.c
+++ b/g10/decrypt.c
@@ -66,7 +66,7 @@ decrypt_message( const char *filename )
errno = EPERM;
}
if( !fp ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error (_("can't open `%s': %s\n"), print_fname_stdin(filename),
gpg_strerror (rc));
return rc;
diff --git a/g10/encode.c b/g10/encode.c
index 292e2bc5a..1ce5e01de 100644
--- a/g10/encode.c
+++ b/g10/encode.c
@@ -189,7 +189,7 @@ encode_simple( const char *filename, int mode, int use_seskey )
errno = EPERM;
}
if( !inp ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"), filename? filename: "[stdin]",
strerror(errno) );
return rc;
@@ -481,7 +481,7 @@ encode_crypt( const char *filename, STRLIST remusr, int use_symkey )
errno = EPERM;
}
if( !inp ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"),
filename? filename: "[stdin]",
gpg_strerror (rc) );
diff --git a/g10/exec.c b/g10/exec.c
index 203c4c78f..268a1a5d8 100644
--- a/g10/exec.c
+++ b/g10/exec.c
@@ -441,7 +441,7 @@ int exec_write(struct exec_info **info,const char *program,
(*info)->tochild=fdopen(to[1],binary?"wb":"w");
if((*info)->tochild==NULL)
{
- ret = gpg_error_from_errno (errno);
+ ret = gpg_error_from_syserror ();
close(to[1]);
goto fail;
}
@@ -451,7 +451,7 @@ int exec_write(struct exec_info **info,const char *program,
(*info)->fromchild=iobuf_fdopen(from[0],"r");
if((*info)->fromchild==NULL)
{
- ret = gpg_error_from_errno (errno);
+ ret = gpg_error_from_syserror ();
close(from[0]);
goto fail;
}
@@ -476,7 +476,7 @@ int exec_write(struct exec_info **info,const char *program,
(*info)->tochild=fopen((*info)->tempfile_in,binary?"wb":"w");
if((*info)->tochild==NULL)
{
- ret = gpg_error_from_errno (errno);
+ ret = gpg_error_from_syserror ();
log_error(_("can't create `%s': %s\n"),
(*info)->tempfile_in,strerror(errno));
goto fail;
@@ -550,7 +550,7 @@ int exec_read(struct exec_info *info)
}
if(info->fromchild==NULL)
{
- ret = gpg_error_from_errno (errno);
+ ret = gpg_error_from_syserror ();
log_error(_("unable to read external program response: %s\n"),
strerror(errno));
goto fail;
diff --git a/g10/gpg.c b/g10/gpg.c
index 79617ee3c..472dc50d0 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1834,7 +1834,7 @@ main (int argc, char **argv )
opt.rfc2440_text=1;
opt.def_sig_expire="0";
opt.def_cert_expire="0";
- opt.require_cross_cert = 1;
+ opt.flags.require_cross_cert = 1;
set_homedir ( default_homedir () );
/* Check whether we have a config file on the command line. */
diff --git a/g10/keydb.c b/g10/keydb.c
index b3595cf36..830c5127b 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -112,7 +112,7 @@ maybe_create_keyring (char *filename, int force)
}
if (access (filename, F_OK))
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
*last_slash_in_filename = DIRSEP_C;
goto leave;
}
@@ -166,7 +166,7 @@ maybe_create_keyring (char *filename, int force)
umask (oldmask);
if (!iobuf)
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ( _("error creating keyring `%s': %s\n"),
filename, strerror(errno));
goto leave;
diff --git a/g10/keygen.c b/g10/keygen.c
index 32bccbb5f..260e6625f 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -3732,7 +3732,7 @@ gen_card_key_with_backup (int algo, int keyno, int is_primary,
umask (oldmask);
if (!fp)
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error (_("can't create backup file `%s': %s\n"),
fname, strerror(errno) );
xfree (fname);
diff --git a/g10/keyring.c b/g10/keyring.c
index bd577a63b..56acaa3ea 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -661,7 +661,7 @@ prepare_search (KEYRING_HANDLE hd)
hd->current.iobuf = iobuf_open (hd->current.kr->fname);
if (!hd->current.iobuf)
{
- hd->current.error = gpg_error_from_errno (errno);
+ hd->current.error = gpg_error_from_syserror ();
log_error(_("can't open `%s'\n"), hd->current.kr->fname );
return hd->current.error;
}
@@ -1200,7 +1200,7 @@ create_tmp_file (const char *template,
umask(oldmask);
if (!*r_fp)
{
- int rc = gpg_error_from_errno (errno);
+ int rc = gpg_error_from_syserror ();
log_error(_("can't create `%s': %s\n"), tmpfname, strerror(errno) );
xfree (tmpfname);
xfree (bakfname);
@@ -1232,7 +1232,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname,
#endif
if (rename (fname, bakfname) )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ("renaming `%s' to `%s' failed: %s\n",
fname, bakfname, strerror(errno) );
return rc;
@@ -1247,7 +1247,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname,
unregister_secured_file (fname);
if (rename (tmpfname, fname) )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error (_("renaming `%s' to `%s' failed: %s\n"),
tmpfname, fname, strerror(errno) );
register_secured_file (fname);
@@ -1317,7 +1317,7 @@ write_keyblock (IOBUF fp, KBNODE keyblock)
iobuf_put (fp, 0); /* unused */
if (iobuf_put (fp, cacheval))
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ("writing sigcache packet failed\n");
return rc;
}
@@ -1362,7 +1362,7 @@ keyring_rebuild_cache (void *token,int noisy)
{
if (iobuf_close (tmpfp))
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ("error closing `%s': %s\n",
tmpfilename, strerror (errno));
goto leave;
@@ -1442,7 +1442,7 @@ keyring_rebuild_cache (void *token,int noisy)
{
if (iobuf_close (tmpfp))
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ("error closing `%s': %s\n",
tmpfilename, strerror (errno));
goto leave;
@@ -1486,7 +1486,7 @@ do_copy (int mode, const char *fname, KBNODE root, int secret,
/* Open the source file. Because we do a rename, we have to check the
permissions of the file */
if (access (fname, W_OK))
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
fp = iobuf_open (fname);
if (mode == 1 && !fp && errno == ENOENT) {
@@ -1504,7 +1504,7 @@ do_copy (int mode, const char *fname, KBNODE root, int secret,
umask(oldmask);
if( !newfp )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error (_("can't create `%s': %s\n"), fname, strerror(errno));
return rc;
}
@@ -1521,7 +1521,7 @@ do_copy (int mode, const char *fname, KBNODE root, int secret,
}
}
if( iobuf_close(newfp) ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ("%s: close failed: %s\n", fname, strerror(errno));
return rc;
}
@@ -1530,7 +1530,7 @@ do_copy (int mode, const char *fname, KBNODE root, int secret,
if( !fp )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"), fname, strerror(errno) );
goto leave;
}
@@ -1613,12 +1613,12 @@ do_copy (int mode, const char *fname, KBNODE root, int secret,
/* close both files */
if( iobuf_close(fp) ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error("%s: close failed: %s\n", fname, strerror(errno) );
goto leave;
}
if( iobuf_close(newfp) ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error("%s: close failed: %s\n", tmpfname, strerror(errno) );
goto leave;
}
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 125872e1c..cbf55c091 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -1406,7 +1406,7 @@ keyserver_spawn(enum ks_action action,STRLIST list,KEYDB_SEARCH_DESC *desc,
maxlen=1024;
if(iobuf_read_line(spawn->fromchild,&line,&buflen,&maxlen)==0)
{
- ret = gpg_error_from_errno (errno);
+ ret = gpg_error_from_syserror ();
goto fail; /* i.e. EOF */
}
diff --git a/g10/openfile.c b/g10/openfile.c
index 8c0601c3e..5e3ae3fa8 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -184,7 +184,7 @@ open_outfile( const char *iname, int mode, IOBUF *a )
if( iobuf_is_pipe_filename (iname) && !opt.outfile ) {
*a = iobuf_create(NULL);
if( !*a ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"), "[stdout]", strerror(errno) );
}
else if( opt.verbose )
@@ -261,7 +261,7 @@ open_outfile( const char *iname, int mode, IOBUF *a )
*a = iobuf_create( name );
if( !*a )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't create `%s': %s\n"), name, strerror(errno) );
}
else if( opt.verbose )
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 8032f15f0..9ac259820 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -132,12 +132,12 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
else if (is_secured_filename (fname))
{
errno = EPERM;
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("error creating `%s': %s\n"), fname, strerror(errno) );
goto leave;
}
else if( !(fp = fopen(fname,"wb")) ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("error creating `%s': %s\n"), fname, strerror(errno) );
goto leave;
}
@@ -187,7 +187,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
if( convert ) { /* text mode */
for( ; pt->len; pt->len-- ) {
if( (c = iobuf_get(pt->buf)) == -1 ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ("problem reading source (%u bytes remaining)\n",
(unsigned)pt->len);
goto leave;
@@ -210,7 +210,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
else if( putc( c, fp ) == EOF )
{
if (ferror (fp))
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
else
rc = gpg_error (GPG_ERR_EOF);
log_error ("error writing to `%s': %s\n",
@@ -226,7 +226,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
int len = pt->len > 32768 ? 32768 : pt->len;
len = iobuf_read( pt->buf, buffer, len );
if( len == -1 ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ("problem reading source (%u bytes remaining)\n",
(unsigned)pt->len);
xfree( buffer );
@@ -246,7 +246,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
}
else if( fwrite( buffer, 1, len, fp ) != len )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error ("error writing to `%s': %s\n",
fname, strerror(errno) );
xfree( buffer );
@@ -279,7 +279,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
else if( putc( c, fp ) == EOF )
{
if ( ferror (fp ) )
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
else
rc = gpg_error (GPG_ERR_EOF);
log_error("error writing to `%s': %s\n",
@@ -317,7 +317,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
goto leave;
}
else if( fwrite( buffer, 1, len, fp ) != len ) {
- rc = (errno? gpg_error_from_errno (errno)
+ rc = (errno? gpg_error_from_syserror ()
: gpg_error (GPG_ERR_INTERNAL));
log_error ("error writing to `%s': %s\n",
fname, strerror(errno) );
@@ -345,7 +345,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
}
else if( putc( c, fp ) == EOF )
{
- rc = (errno? gpg_error_from_errno (errno)
+ rc = (errno? gpg_error_from_syserror ()
: gpg_error (GPG_ERR_INTERNAL));
log_error ("error writing to `%s': %s\n",
fname, strerror(errno) );
@@ -385,7 +385,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
}
if( fp && fp != stdout && fclose(fp) ) {
- rc = (errno? gpg_error_from_errno (errno)
+ rc = (errno? gpg_error_from_syserror ()
: gpg_error (GPG_ERR_INTERNAL));
log_error ("error closing `%s': %s\n", fname, strerror(errno) );
fp = NULL;
@@ -487,7 +487,7 @@ ask_for_detached_datafile (gcry_md_hd_t md, gcry_md_hd_t md2,
}
else if( !fp )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"), answer, strerror(errno));
goto leave;
}
@@ -544,7 +544,7 @@ hash_datafiles( gcry_md_hd_t md, gcry_md_hd_t md2, STRLIST files,
errno = EPERM;
}
if( !fp ) {
- int rc = gpg_error_from_errno (errno);
+ int rc = gpg_error_from_syserror ();
log_error(_("can't open signed data `%s'\n"),
print_fname_stdin(sl->d));
return rc;
diff --git a/g10/sign.c b/g10/sign.c
index 7b6a81e10..07947b894 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -808,7 +808,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
}
if( !inp )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error (_("can't open `%s': %s\n"), fname? fname: "[stdin]",
strerror(errno) );
goto leave;
@@ -826,7 +826,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
out = iobuf_create( outfile );
if( !out )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't create `%s': %s\n"), outfile, strerror(errno) );
goto leave;
}
@@ -1003,7 +1003,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
}
if( !inp )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"),
sl->d,strerror(errno));
goto leave;
@@ -1116,7 +1116,7 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
errno = EPERM;
}
if( !inp ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error (_("can't open `%s': %s\n"),
fname? fname: "[stdin]", strerror(errno) );
goto leave;
@@ -1132,7 +1132,7 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
out = iobuf_create( outfile );
if( !out )
{
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't create `%s': %s\n"), outfile, strerror(errno) );
goto leave;
}
@@ -1268,7 +1268,7 @@ sign_symencrypt_file (const char *fname, STRLIST locusr)
errno = EPERM;
}
if( !inp ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error (_("can't open `%s': %s\n"),
fname? fname: "[stdin]", strerror(errno) );
goto leave;
diff --git a/g10/tdbio.c b/g10/tdbio.c
index 11e3bb3fd..c6fe995df 100644
--- a/g10/tdbio.c
+++ b/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) );
}
diff --git a/g10/verify.c b/g10/verify.c
index 54aa76544..f8a1fd90c 100644
--- a/g10/verify.c
+++ b/g10/verify.c
@@ -98,7 +98,7 @@ verify_signatures( int nfiles, char **files )
errno = EPERM;
}
if( !fp ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"),
print_fname_stdin(sigfile), strerror (errno));
return rc;
@@ -154,7 +154,7 @@ verify_one_file( const char *name )
errno = EPERM;
}
if( !fp ) {
- rc = gpg_error_from_errno (errno);
+ rc = gpg_error_from_syserror ();
log_error(_("can't open `%s': %s\n"),
print_fname_stdin(name), strerror (errno));
print_file_status( STATUS_FILE_ERROR, name, 1 );