[svn] gpgme - r1237 - trunk/gpgme
svn author marcus
cvs at cvs.gnupg.org
Fri Jul 13 16:47:43 CEST 2007
Author: marcus
Date: 2007-07-13 16:47:07 +0200 (Fri, 13 Jul 2007)
New Revision: 1237
Modified:
trunk/gpgme/ChangeLog
trunk/gpgme/data-compat.c
trunk/gpgme/data-user.c
trunk/gpgme/gpgme.c
Log:
2007-07-13 Marcus Brinkmann <marcus at g10code.de>
* data-user.c (user_read, user_write, user_seek): Set errno and
return -1 instead returning the error code directly.
* data-compat.c (old_user_seek): Likewise.
* gpgme.c (gpgme_sig_notation_add): Return error properly.
Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog 2007-07-13 01:57:02 UTC (rev 1236)
+++ trunk/gpgme/ChangeLog 2007-07-13 14:47:07 UTC (rev 1237)
@@ -1,5 +1,10 @@
2007-07-13 Marcus Brinkmann <marcus at g10code.de>
+ * data-user.c (user_read, user_write, user_seek): Set errno and
+ return -1 instead returning the error code directly.
+ * data-compat.c (old_user_seek): Likewise.
+ * gpgme.c (gpgme_sig_notation_add): Return error properly.
+
* Revert the "close_notify_handler" returns int stuff. Always
close in the _gpgme_io_close implementations.
* engine-gpgsm.c (status_handler): Try to terminate the connection
Modified: trunk/gpgme/data-compat.c
===================================================================
--- trunk/gpgme/data-compat.c 2007-07-13 01:57:02 UTC (rev 1236)
+++ trunk/gpgme/data-compat.c 2007-07-13 14:47:07 UTC (rev 1237)
@@ -167,7 +167,10 @@
{
gpgme_error_t err;
if (whence != SEEK_SET || offset)
- return EINVAL;
+ {
+ errno = EINVAL;
+ return -1;
+ }
err = (*dh->data.old_user.cb) (dh->data.old_user.handle, NULL, 0, NULL);
if (err)
return gpgme_error_to_errno (err);
Modified: trunk/gpgme/data-user.c
===================================================================
--- trunk/gpgme/data-user.c 2007-07-13 01:57:02 UTC (rev 1236)
+++ trunk/gpgme/data-user.c 2007-07-13 14:47:07 UTC (rev 1237)
@@ -32,7 +32,10 @@
user_read (gpgme_data_t dh, void *buffer, size_t size)
{
if (!dh->data.user.cbs->read)
- return EBADF;
+ {
+ errno = EBADF;
+ return -1;
+ }
return (*dh->data.user.cbs->read) (dh->data.user.handle, buffer, size);
}
@@ -42,7 +45,10 @@
user_write (gpgme_data_t dh, const void *buffer, size_t size)
{
if (!dh->data.user.cbs->write)
- return EBADF;
+ {
+ errno = EBADF;
+ return -1;
+ }
return (*dh->data.user.cbs->write) (dh->data.user.handle, buffer, size);
}
@@ -52,7 +58,10 @@
user_seek (gpgme_data_t dh, off_t offset, int whence)
{
if (!dh->data.user.cbs->seek)
- return EBADF;
+ {
+ errno = EBADF;
+ return -1;
+ }
return (*dh->data.user.cbs->seek) (dh->data.user.handle, offset, whence);
}
Modified: trunk/gpgme/gpgme.c
===================================================================
--- trunk/gpgme/gpgme.c 2007-07-13 01:57:02 UTC (rev 1236)
+++ trunk/gpgme/gpgme.c 2007-07-13 14:47:07 UTC (rev 1237)
@@ -471,7 +471,7 @@
gpgme_sig_notation_t *lastp;
if (!ctx)
- gpg_error (GPG_ERR_INV_VALUE);
+ return gpg_error (GPG_ERR_INV_VALUE);
if (name)
flags |= GPGME_SIG_NOTATION_HUMAN_READABLE;
More information about the Gnupg-commits
mailing list