1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Take advantage of newer gpg-error features.

This commit is contained in:
Werner Koch 2006-09-14 16:50:33 +00:00
parent 9577dd45ab
commit 03d3322e5f
55 changed files with 297 additions and 260 deletions

View file

@ -1,3 +1,8 @@
2006-09-14 Werner Koch <wk@g10code.com>
Replaced all call gpg_error_from_errno(errno) by
gpg_error_from_syserror().
2006-09-13 Werner Koch <wk@g10code.com>
* keylist.c (list_internal_keys): Print marker line to FP and not

View file

@ -451,7 +451,7 @@ base64_writer_cb (void *cb_value, const void *buffer, size_t count)
parm->base64.idx = idx;
parm->base64.quad_count = quad_count;
return ferror (fp) ? gpg_error_from_errno (errno) : 0;
return ferror (fp) ? gpg_error_from_syserror () : 0;
}
static int

View file

@ -351,7 +351,7 @@ find_up_external (KEYDB_HANDLE kh, const char *issuer, ksba_sexp_t keyid)
pattern = xtrymalloc (strlen (s)+2);
if (!pattern)
return gpg_error_from_errno (errno);
return gpg_error_from_syserror ();
strcpy (stpcpy (pattern, "/"), s);
add_to_strlist (&names, pattern);
xfree (pattern);

View file

@ -117,7 +117,7 @@ insert_duptable (duptable_t *table, unsigned char *fpr, int *exists)
/* Insert that fingerprint. */
t = xtrymalloc (sizeof *t);
if (!t)
return gpg_error_from_errno (errno);
return gpg_error_from_syserror ();
memcpy (t->fpr, fpr+1, 19);
t->next = table[idx];
table[idx] = t;
@ -558,14 +558,14 @@ export_p12 (ctrl_t ctrl, const unsigned char *certimg, size_t certimglen,
infp = tmpfile ();
if (!infp)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
log_error (_("error creating temporary file: %s\n"), strerror (errno));
goto cleanup;
}
if (fwrite (certimg, certimglen, 1, infp) != 1)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
log_error (_("error writing to temporary file: %s\n"),
strerror (errno));
goto cleanup;
@ -574,7 +574,7 @@ export_p12 (ctrl_t ctrl, const unsigned char *certimg, size_t certimglen,
outfp = tmpfile ();
if (!outfp)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
log_error (_("error creating temporary file: %s\n"), strerror (errno));
goto cleanup;
}

View file

@ -521,7 +521,7 @@ parse_p12 (ctrl_t ctrl, ksba_reader_t reader,
tmpfp = tmpfile ();
if (!tmpfp)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
log_error (_("error creating temporary file: %s\n"), strerror (errno));
goto cleanup;
}
@ -529,7 +529,7 @@ parse_p12 (ctrl_t ctrl, ksba_reader_t reader,
{
if (nread && fwrite (buffer, nread, 1, tmpfp) != 1)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
log_error (_("error writing to temporary file: %s\n"),
strerror (errno));
goto cleanup;
@ -546,7 +546,7 @@ parse_p12 (ctrl_t ctrl, ksba_reader_t reader,
certfp = tmpfile ();
if (!certfp)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
log_error (_("error creating temporary file: %s\n"), strerror (errno));
goto cleanup;
}

View file

@ -1164,7 +1164,7 @@ list_internal_keys (ctrl_t ctrl, STRLIST names, FILE *fp,
desc = xtrycalloc (ndesc, sizeof *desc);
if (!ndesc)
{
rc = gpg_error_from_errno (errno);
rc = gpg_error_from_syserror ();
log_error ("out of core\n");
goto leave;
}

View file

@ -70,7 +70,7 @@ read_list (char *key, char *country, int *lnr)
listfp = fopen (listname, "r");
if (!listfp && errno != ENOENT)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
log_error (_("can't open `%s': %s\n"), listname, gpg_strerror (err));
return err;
}
@ -85,7 +85,7 @@ read_list (char *key, char *country, int *lnr)
{
if (feof (listfp))
return gpg_error (GPG_ERR_EOF);
return gpg_error_from_errno (errno);
return gpg_error_from_syserror ();
}
if (!*line || line[strlen(line)-1] != '\n')
@ -234,7 +234,7 @@ gpgsm_qualified_consent (ctrl_t ctrl, ksba_cert_t cert)
"to create or verify such signatures.\n"),
opt.qualsig_approval? "":"\n"
) < 0 )
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
else
err = 0;
@ -251,7 +251,7 @@ gpgsm_qualified_consent (ctrl_t ctrl, ksba_cert_t cert)
buffer = p = xtrymalloc (strlen (name) * 3 + 1);
if (!buffer)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
free (name);
return err;
}
@ -324,7 +324,7 @@ gpgsm_not_qualified_warning (ctrl_t ctrl, ksba_cert_t cert)
"Note, that this certificate will NOT create a "
"qualified signature!"),
subject? subject:"?") < 0 )
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
else
err = 0;
@ -341,7 +341,7 @@ gpgsm_not_qualified_warning (ctrl_t ctrl, ksba_cert_t cert)
buffer = p = xtrymalloc (strlen (name) * 3 + 1);
if (!buffer)
{
err = gpg_error_from_errno (errno);
err = gpg_error_from_syserror ();
free (name);
return err;
}