[svn] GnuPG - r5303 - trunk/g10
svn author wk
cvs at cvs.gnupg.org
Thu Apr 1 15:24:56 CEST 2010
Author: wk
Date: 2010-04-01 15:24:55 +0200 (Thu, 01 Apr 2010)
New Revision: 5303
Modified:
trunk/g10/ChangeLog
trunk/g10/dearmor.c
trunk/g10/decrypt.c
trunk/g10/encrypt.c
trunk/g10/exec.c
trunk/g10/gpg.c
trunk/g10/import.c
trunk/g10/keydb.c
trunk/g10/keyedit.c
trunk/g10/keygen.c
trunk/g10/keyring.c
trunk/g10/openfile.c
trunk/g10/photoid.c
trunk/g10/plaintext.c
trunk/g10/sign.c
trunk/g10/tdbdump.c
trunk/g10/tdbio.c
trunk/g10/verify.c
Log:
Use gpg_err_set_errno to assign values to ERRNO.
Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/ChangeLog 2010-04-01 13:24:55 UTC (rev 5303)
@@ -1,3 +1,7 @@
+2010-04-01 Werner Koch <wk at g10code.com>
+
+ Use gpg_err_set_errno to set ERRNO.
+
2010-03-26 Werner Koch <wk at g10code.com>
* signal.c (pause_on_sigusr): Remove. It was used in ancient gpg
Modified: trunk/g10/dearmor.c
===================================================================
--- trunk/g10/dearmor.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/dearmor.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -53,7 +53,7 @@
{
iobuf_close (inp);
inp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!inp) {
rc = gpg_error_from_syserror ();
@@ -100,7 +100,7 @@
{
iobuf_close (inp);
inp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!inp) {
rc = gpg_error_from_syserror ();
Modified: trunk/g10/decrypt.c
===================================================================
--- trunk/g10/decrypt.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/decrypt.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -59,7 +59,7 @@
{
iobuf_close (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if ( !fp )
{
@@ -118,7 +118,7 @@
{
iobuf_close (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!fp)
{
@@ -228,7 +228,7 @@
{
iobuf_close (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!fp)
{
Modified: trunk/g10/encrypt.c
===================================================================
--- trunk/g10/encrypt.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/encrypt.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -190,7 +190,7 @@
{
iobuf_close (inp);
inp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!inp)
{
@@ -531,7 +531,7 @@
{
iobuf_close (inp);
inp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!inp)
{
Modified: trunk/g10/exec.c
===================================================================
--- trunk/g10/exec.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/exec.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -463,7 +463,7 @@
if( is_secured_filename ((*info)->tempfile_in) )
{
(*info)->tochild = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
(*info)->tochild=fopen((*info)->tempfile_in,binary?"wb":"w");
@@ -545,7 +545,7 @@
{
iobuf_close (info->fromchild);
info->fromchild = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if(info->fromchild==NULL)
{
Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/gpg.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -1107,7 +1107,7 @@
/* if (is_secured_filename (fname)) */
/* { */
/* fd = -1; */
-/* errno = EPERM; */
+/* gpg_err_set_errno (EPERM); */
/* } */
/* else */
/* { */
@@ -2108,7 +2108,7 @@
{
fclose (configfp);
configfp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !configfp ) {
if( default_config ) {
@@ -4037,7 +4037,7 @@
{
iobuf_close (a);
a = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !a )
log_error(_("can't open `%s'\n"), print_fname_stdin(fname));
@@ -4224,7 +4224,7 @@
{
fclose (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
}
if( !fp ) {
Modified: trunk/g10/import.c
===================================================================
--- trunk/g10/import.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/import.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -187,7 +187,7 @@
{
iobuf_close (inp2);
inp2 = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !inp2 )
log_error(_("can't open `%s': %s\n"), fname, strerror(errno) );
Modified: trunk/g10/keydb.c
===================================================================
--- trunk/g10/keydb.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/keydb.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -170,7 +170,7 @@
if (is_secured_filename (filename))
{
iobuf = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
iobuf = iobuf_create (filename);
Modified: trunk/g10/keyedit.c
===================================================================
--- trunk/g10/keyedit.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/keyedit.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -1971,7 +1971,7 @@
{
iobuf_close (a);
a = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!a)
{
Modified: trunk/g10/keygen.c
===================================================================
--- trunk/g10/keygen.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/keygen.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -2871,7 +2871,7 @@
{
iobuf_close (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!fp) {
log_error (_("can't open `%s': %s\n"), fname, strerror(errno) );
@@ -3388,7 +3388,7 @@
if (is_secured_filename (outctrl->pub.fname) )
{
outctrl->pub.stream = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
outctrl->pub.stream = iobuf_create( outctrl->pub.fname );
@@ -3421,7 +3421,7 @@
if (is_secured_filename (outctrl->sec.fname) )
{
outctrl->sec.stream = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
outctrl->sec.stream = iobuf_create( outctrl->sec.fname );
@@ -4158,7 +4158,7 @@
if (is_secured_filename (fname))
{
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
fp = iobuf_create (fname);
Modified: trunk/g10/keyring.c
===================================================================
--- trunk/g10/keyring.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/keyring.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -1226,7 +1226,7 @@
if (is_secured_filename (tmpfname))
{
*r_fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
*r_fp = iobuf_create (tmpfname);
@@ -1558,7 +1558,7 @@
oldmask=umask(077);
if (!secret && is_secured_filename (fname)) {
newfp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
newfp = iobuf_create (fname);
Modified: trunk/g10/openfile.c
===================================================================
--- trunk/g10/openfile.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/openfile.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -284,7 +284,7 @@
if (is_secured_filename (name) )
{
*a = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
*a = iobuf_create (name);
@@ -329,7 +329,7 @@
{
iobuf_close (a);
a = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( a && opt.verbose )
log_info(_("assuming signed data in `%s'\n"), buf );
@@ -366,7 +366,7 @@
{
fclose (src);
src = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !src ) {
log_info (_("can't open `%s': %s\n"), fname, strerror(errno) );
@@ -378,7 +378,7 @@
if ( is_secured_filename (fname) )
{
dst = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
dst = fopen( fname, "w" );
Modified: trunk/g10/photoid.c
===================================================================
--- trunk/g10/photoid.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/photoid.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -110,7 +110,7 @@
{
iobuf_close (file);
file = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if(!file)
{
Modified: trunk/g10/plaintext.c
===================================================================
--- trunk/g10/plaintext.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/plaintext.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -158,7 +158,7 @@
;
else if (is_secured_filename (fname))
{
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
rc = gpg_error_from_syserror ();
log_error (_("error creating `%s': %s\n"), fname, strerror (errno));
goto leave;
@@ -548,7 +548,7 @@
{
iobuf_close (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!fp && errno == ENOENT)
{
@@ -622,7 +622,7 @@
{
iobuf_close (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if (!fp)
{
@@ -654,7 +654,7 @@
if (is_secured_file (data_fd))
{
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
fp = iobuf_fdopen_nc (data_fd, "rb");
Modified: trunk/g10/sign.c
===================================================================
--- trunk/g10/sign.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/sign.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -783,7 +783,7 @@
{
iobuf_close (inp);
inp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !inp )
{
@@ -799,7 +799,7 @@
if( outfile ) {
if (is_secured_filename ( outfile )) {
out = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
out = iobuf_create( outfile );
@@ -978,7 +978,7 @@
{
iobuf_close (inp);
inp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !inp )
{
@@ -1095,7 +1095,7 @@
{
iobuf_close (inp);
inp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !inp ) {
rc = gpg_error_from_syserror ();
@@ -1108,7 +1108,7 @@
if( outfile ) {
if (is_secured_filename (outfile) ) {
outfile = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
out = iobuf_create( outfile );
@@ -1250,7 +1250,7 @@
{
iobuf_close (inp);
inp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !inp ) {
rc = gpg_error_from_syserror ();
Modified: trunk/g10/tdbdump.c
===================================================================
--- trunk/g10/tdbdump.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/tdbdump.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -146,7 +146,7 @@
if (is_secured_file (fileno (fp)))
{
fclose (fp);
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
log_error (_("can't open `%s': %s\n"), fname, strerror(errno) );
return;
}
Modified: trunk/g10/tdbio.c
===================================================================
--- trunk/g10/tdbio.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/tdbio.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -539,7 +539,7 @@
oldmask=umask(077);
if (is_secured_filename (fname)) {
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
else
fp =fopen( fname, "wb" );
Modified: trunk/g10/verify.c
===================================================================
--- trunk/g10/verify.c 2010-03-29 12:57:11 UTC (rev 5302)
+++ trunk/g10/verify.c 2010-04-01 13:24:55 UTC (rev 5303)
@@ -91,7 +91,7 @@
{
iobuf_close (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !fp ) {
rc = gpg_error_from_syserror ();
@@ -154,7 +154,7 @@
{
iobuf_close (fp);
fp = NULL;
- errno = EPERM;
+ gpg_err_set_errno (EPERM);
}
if( !fp ) {
rc = gpg_error_from_syserror ();
More information about the Gnupg-commits
mailing list