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.
This commit is contained in:
parent
5d25b54f30
commit
d258f5f735
@ -1,5 +1,10 @@
|
||||
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
|
||||
|
@ -167,7 +167,10 @@ old_user_seek (gpgme_data_t dh, off_t offset, int whence)
|
||||
{
|
||||
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);
|
||||
|
@ -32,7 +32,10 @@ static ssize_t
|
||||
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 @@ static ssize_t
|
||||
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 @@ static off_t
|
||||
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);
|
||||
}
|
||||
|
@ -471,7 +471,7 @@ gpgme_sig_notation_add (gpgme_ctx_t ctx, const char *name,
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user