mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-14 21:47:19 +02:00
* assuan-buffer.c (writen,readline) [USE_GNU_PT]: Use pth_read/write.
* assuan-socket-server.c (accept_connection) [USE_GNU_PTH]: Ditto.
This commit is contained in:
parent
eeb5cdb962
commit
ebb00fa843
3 changed files with 23 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue