diff options
author | Marcus Brinkmann <[email protected]> | 2009-06-22 14:50:17 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2009-06-22 14:50:17 +0000 |
commit | 1c454aee81e38ffbc4a615092742ae4b1e37b57f (patch) | |
tree | fa9b1896ce8bf617b6712ba95620e811d0abb9ef /tests | |
parent | 2009-06-18 Marcus Brinkmann <[email protected]> (diff) | |
download | gpgme-1c454aee81e38ffbc4a615092742ae4b1e37b57f.tar.gz gpgme-1c454aee81e38ffbc4a615092742ae4b1e37b57f.zip |
2009-06-22 Marcus Brinkmann <[email protected]>
* configure.ac: Add AC_TYPE_UINTPTR_T.
* assuan/assuan.h [_ASSUAN_IN_GPGME_BUILD_ASSUAN]: Declare
_gpgme_io_connect.
src/
2009-06-22 Marcus Brinkmann <[email protected]>
* debug.h: Everywhere, use %p instead of 0x%x to print pointer.
[HAVE_STDINT_H]: Include <stdint.h>.
(_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
to (uintptr_t) before casting it to (void*) to silence GCC
warning.
* gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
* sign.c (_GPGME_IN_GPGME): Define it.
* keylist.c (_GPGME_IN_GPGME): Define it.
* debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
vasprintf and asprintf.
* priv-io.h: Include <sys/socket.h>. Declare _gpgme_io_connect.
tests/
2009-06-22 Marcus Brinkmann <[email protected]>
* gpg/t-support.h (passphrase_cb): Implement write() according to
the book to silence compiler warning.
* gpgsm/t-support.h (passphrase_cb): Likewise.
Diffstat (limited to '')
-rw-r--r-- | tests/ChangeLog | 6 | ||||
-rw-r--r-- | tests/gpg/t-support.h | 15 | ||||
-rw-r--r-- | tests/gpgsm/t-support.h | 16 |
3 files changed, 34 insertions, 3 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index fcdf1565..ab9a60aa 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2009-06-22 Marcus Brinkmann <[email protected]> + + * gpg/t-support.h (passphrase_cb): Implement write() according to + the book to silence compiler warning. + * gpgsm/t-support.h (passphrase_cb): Likewise. + 2009-06-16 Werner Koch <[email protected]> * gpg/pgp-import.c: New. diff --git a/tests/gpg/t-support.h b/tests/gpg/t-support.h index 13475f29..6e282a34 100644 --- a/tests/gpg/t-support.h +++ b/tests/gpg/t-support.h @@ -80,7 +80,20 @@ passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info, DWORD written; WriteFile ((HANDLE) fd, "abc\n", 4, &written, 0); #else - write (fd, "abc\n", 4); + int res; + char *pass = "abc\n"; + int passlen = strlen (pass); + int off = 0; + + do + { + res = write (fd, &pass[off], passlen - off); + if (res > 0) + off += res; + } + while (res > 0 && off != passlen); + + return off == passlen ? 0 : gpgme_error_from_errno (errno); #endif return 0; diff --git a/tests/gpgsm/t-support.h b/tests/gpgsm/t-support.h index 07f00c38..6dc14569 100644 --- a/tests/gpgsm/t-support.h +++ b/tests/gpgsm/t-support.h @@ -62,8 +62,20 @@ gpgme_error_t passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info, int last_was_bad, int fd) { - write (fd, "abc\n", 4); - return 0; + int res; + char *pass = "abc\n"; + int passlen = strlen (pass); + int off = 0; + + do + { + res = write (fd, &pass[off], passlen - off); + if (res > 0) + off += res; + } + while (res > 0 && off != passlen); + + return off == passlen ? 0 : gpgme_error_from_errno (errno); } |