summaryrefslogtreecommitdiffstats
path: root/g10/keyring.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-09-14 18:50:33 +0200
committerWerner Koch <wk@gnupg.org>2006-09-14 18:50:33 +0200
commit03d3322e5fb928d48ea4192fd2f2cc851d791421 (patch)
tree768acc2e54f6e4abcc405e665bf058aa1556d3f5 /g10/keyring.c
parentVarious fixes and new features. (diff)
downloadgnupg2-03d3322e5fb928d48ea4192fd2f2cc851d791421.tar.xz
gnupg2-03d3322e5fb928d48ea4192fd2f2cc851d791421.zip
Take advantage of newer gpg-error features.
Diffstat (limited to 'g10/keyring.c')
-rw-r--r--g10/keyring.c26
1 files changed, 13 insertions, 13 deletions
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;
}