2007-07-13 Marcus Brinkmann <marcus@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
{
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);
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);
}
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);
}
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);
}
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;