summaryrefslogtreecommitdiff
path: root/common/tio.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-12-29 22:50:31 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-12-29 22:50:31 +0000
commite985efa83458e1cc9c2bcb12e3cc10b6526c3399 (patch)
tree8311cb525c9d452d62d88280e6cca854496f9c42 /common/tio.c
parent4e9224817ee303404b804a1a51f2f9c9a49164e4 (diff)
parented6bc27721075adf0215ad8b856fcdcf7b98b9b7 (diff)
merge changes from trunk
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1349 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'common/tio.c')
-rw-r--r--common/tio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/tio.c b/common/tio.c
index 0914a4a..468d5cb 100644
--- a/common/tio.c
+++ b/common/tio.c
@@ -295,7 +295,12 @@ int tio_read(TFILE *fp, void *buf, size_t count)
/* read the input in the buffer */
rv=read(fp->fd,fp->readbuffer.buffer+fp->readbuffer.start,fp->readbuffer.size-fp->readbuffer.start);
/* check for errors */
- if ((rv==0)||((rv<0)&&(errno!=EINTR)&&(errno!=EAGAIN)))
+ if (rv==0)
+ {
+ errno=ECONNRESET;
+ return -1;
+ }
+ else if ((rv<0)&&(errno!=EINTR)&&(errno!=EAGAIN))
return -1; /* something went wrong with the read */
/* skip the read part in the buffer */
fp->readbuffer.len=rv;