diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-05-06 23:53:48 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-05-06 23:53:48 +0000 |
commit | 1c2d9cb63774f46f70f20ca8daa70f451886da1f (patch) | |
tree | cd2d311458fb6399644a1b1aa64b09cd3c908549 /src/interfaces/libpq/fe-misc.c | |
parent | edbd51395c425795b3ccacbc9d26044beb1a1277 (diff) | |
download | postgresql-1c2d9cb63774f46f70f20ca8daa70f451886da1f.tar.gz postgresql-1c2d9cb63774f46f70f20ca8daa70f451886da1f.zip |
It seems the regression tests don't cover copy in/out at all, so
code that I had assumed was working had not been tested. Naturally,
it was broken ...
Tom Lane
Diffstat (limited to 'src/interfaces/libpq/fe-misc.c')
-rw-r--r-- | src/interfaces/libpq/fe-misc.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index d7fc71dd134..3d3cf2a7197 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -24,7 +24,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.11 1998/05/06 23:51:14 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.12 1998/05/06 23:53:48 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -342,6 +342,15 @@ tryAgain: { if (errno == EINTR) goto tryAgain; + /* Some systems return EAGAIN/EWOULDBLOCK for no data */ +#ifdef EAGAIN + if (errno == EAGAIN) + return 0; +#endif +#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN)) + if (errno == EWOULDBLOCK) + return 0; +#endif sprintf(conn->errorMessage, "pqReadData() -- read() failed: errno=%d\n%s\n", errno, strerror(errno)); @@ -374,6 +383,15 @@ tryAgain2: { if (errno == EINTR) goto tryAgain2; + /* Some systems return EAGAIN/EWOULDBLOCK for no data */ +#ifdef EAGAIN + if (errno == EAGAIN) + return 0; +#endif +#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN)) + if (errno == EWOULDBLOCK) + return 0; +#endif sprintf(conn->errorMessage, "pqReadData() -- read() failed: errno=%d\n%s\n", errno, strerror(errno)); |