lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1344 - nss-pam-ldapd/common

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1344 - nss-pam-ldapd/common



Author: arthur
Date: Sun Dec 26 16:00:36 2010
New Revision: 1344
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1344

Log:
return connection reset when connection was closed by the other end

Modified:
   nss-pam-ldapd/common/tio.c

Modified: nss-pam-ldapd/common/tio.c
==============================================================================
--- nss-pam-ldapd/common/tio.c  Sun Dec 26 15:56:59 2010        (r1343)
+++ nss-pam-ldapd/common/tio.c  Sun Dec 26 16:00:36 2010        (r1344)
@@ -295,7 +295,12 @@
     /* 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;
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits