summaryrefslogtreecommitdiffstats
path: root/assuan
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2002-02-12 21:41:34 +0100
committerWerner Koch <wk@gnupg.org>2002-02-12 21:41:34 +0100
commitebb00fa8438a211f6c0c97a15fefea35b736adfe (patch)
treef84be65ccf39e36772ad2ada9b83222b97428a76 /assuan
parentSet version numbers add a comment (diff)
downloadgnupg2-ebb00fa8438a211f6c0c97a15fefea35b736adfe.tar.xz
gnupg2-ebb00fa8438a211f6c0c97a15fefea35b736adfe.zip
* assuan-buffer.c (writen,readline) [USE_GNU_PT]: Use pth_read/write.
* assuan-socket-server.c (accept_connection) [USE_GNU_PTH]: Ditto.
Diffstat (limited to 'assuan')
-rw-r--r--assuan/ChangeLog5
-rw-r--r--assuan/assuan-buffer.c12
-rw-r--r--assuan/assuan-socket-server.c7
3 files changed, 23 insertions, 1 deletions
diff --git a/assuan/ChangeLog b/assuan/ChangeLog
index 290fef58d..f9c755529 100644
--- a/assuan/ChangeLog
+++ b/assuan/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-12 Werner Koch <wk@gnupg.org>
+
+ * assuan-buffer.c (writen,readline) [USE_GNU_PT]: Use pth_read/write.
+ * assuan-socket-server.c (accept_connection) [USE_GNU_PTH]: Ditto.
+
2002-02-01 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (MOSTLYCLEANFILES): New variable.
diff --git a/assuan/assuan-buffer.c b/assuan/assuan-buffer.c
index bd0881743..e349a692b 100644
--- a/assuan/assuan-buffer.c
+++ b/assuan/assuan-buffer.c
@@ -25,7 +25,9 @@
#include <errno.h>
#include <unistd.h>
#include <assert.h>
-
+#ifdef USE_GNU_PTH
+# include <pth.h>
+#endif
#include "assuan-defs.h"
@@ -34,7 +36,11 @@ writen ( int fd, const char *buffer, size_t length )
{
while (length)
{
+#ifdef USE_GNU_PTH
+ int nwritten = pth_write (fd, buffer, length);
+#else
int nwritten = write (fd, buffer, length);
+#endif
if (nwritten < 0)
{
@@ -59,7 +65,11 @@ readline (int fd, char *buf, size_t buflen, int *r_nread, int *eof)
*r_nread = 0;
while (nleft > 0)
{
+#ifdef USE_GNU_PTH
+ int n = pth_read (fd, buf, nleft);
+#else
int n = read (fd, buf, nleft);
+#endif
if (n < 0)
{
if (errno == EINTR)
diff --git a/assuan/assuan-socket-server.c b/assuan/assuan-socket-server.c
index 6ad6455e9..d10d9d4a9 100644
--- a/assuan/assuan-socket-server.c
+++ b/assuan/assuan-socket-server.c
@@ -25,6 +25,9 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
+#ifdef USE_GNU_PTH
+# include <pth.h>
+#endif
#include "assuan-defs.h"
@@ -35,7 +38,11 @@ accept_connection (ASSUAN_CONTEXT ctx)
struct sockaddr_un clnt_addr;
size_t len = sizeof clnt_addr;
+#ifdef USE_GNU_PTH
+ fd = pth_accept (ctx->listen_fd, (struct sockaddr*)&clnt_addr, &len );
+#else
fd = accept (ctx->listen_fd, (struct sockaddr*)&clnt_addr, &len );
+#endif
if (fd == -1)
{
ctx->os_errno = errno;