gpgme/gpgme (ChangeLog data-user.c)
cvs user marcus
cvs at cvs.gnupg.org
Thu May 5 13:41:50 CEST 2005
Date: Thursday, May 5, 2005 @ 14:00:11
Author: marcus
Path: /cvs/gpgme/gpgme/gpgme
Modified: ChangeLog data-user.c
2005-05-05 Marcus Brinkmann <marcus at g10code.de>
* data-user.c (user_release): Only call user hook if provided.
(user_seek): Return EBADF if no user hook is provided.
(user_read): Likewise.
(user_write): Likewise.
-------------+
ChangeLog | 7 +++++++
data-user.c | 12 +++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
Index: gpgme/gpgme/ChangeLog
diff -u gpgme/gpgme/ChangeLog:1.398 gpgme/gpgme/ChangeLog:1.399
--- gpgme/gpgme/ChangeLog:1.398 Thu Apr 28 18:11:33 2005
+++ gpgme/gpgme/ChangeLog Thu May 5 14:00:11 2005
@@ -1,3 +1,10 @@
+2005-05-05 Marcus Brinkmann <marcus at g10code.de>
+
+ * data-user.c (user_release): Only call user hook if provided.
+ (user_seek): Return EBADF if no user hook is provided.
+ (user_read): Likewise.
+ (user_write): Likewise.
+
2005-04-28 Marcus Brinkmann <marcus at g10code.de>
* gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
Index: gpgme/gpgme/data-user.c
diff -u gpgme/gpgme/data-user.c:1.5 gpgme/gpgme/data-user.c:1.6
--- gpgme/gpgme/data-user.c:1.5 Tue Dec 7 22:13:36 2004
+++ gpgme/gpgme/data-user.c Thu May 5 14:00:11 2005
@@ -30,6 +30,9 @@
static ssize_t
user_read (gpgme_data_t dh, void *buffer, size_t size)
{
+ if (!dh->data.user.cbs->read)
+ return EBADF;
+
return (*dh->data.user.cbs->read) (dh->data.user.handle, buffer, size);
}
@@ -37,6 +40,9 @@
static ssize_t
user_write (gpgme_data_t dh, const void *buffer, size_t size)
{
+ if (!dh->data.user.cbs->write)
+ return EBADF;
+
return (*dh->data.user.cbs->write) (dh->data.user.handle, buffer, size);
}
@@ -44,6 +50,9 @@
static off_t
user_seek (gpgme_data_t dh, off_t offset, int whence)
{
+ if (!dh->data.user.cbs->seek)
+ return EBADF;
+
return (*dh->data.user.cbs->seek) (dh->data.user.handle, offset, whence);
}
@@ -51,7 +60,8 @@
static void
user_release (gpgme_data_t dh)
{
- (*dh->data.user.cbs->release) (dh->data.user.handle);
+ if (dh->data.user.cbs->release)
+ (*dh->data.user.cbs->release) (dh->data.user.handle);
}
More information about the Gnupg-commits
mailing list