summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-15 01:26:24 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-15 01:26:24 +0800
commite2b4af20009f9963522b6e31c75b3f79b61f5394 (patch)
tree07415dbe49f00ae708aac354bfb8b62cd41b4028 /daemon
parent926e1bd0914dd601923cec7de07dc192e76eda5c (diff)
downloadpttbbs-e2b4af20009f9963522b6e31c75b3f79b61f5394.tar
pttbbs-e2b4af20009f9963522b6e31c75b3f79b61f5394.tar.gz
pttbbs-e2b4af20009f9963522b6e31c75b3f79b61f5394.tar.bz2
pttbbs-e2b4af20009f9963522b6e31c75b3f79b61f5394.tar.lz
pttbbs-e2b4af20009f9963522b6e31c75b3f79b61f5394.tar.xz
pttbbs-e2b4af20009f9963522b6e31c75b3f79b61f5394.tar.zst
pttbbs-e2b4af20009f9963522b6e31c75b3f79b61f5394.zip
* fix socket error handling (thanks to Kuang/wens)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4616 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'daemon')
-rw-r--r--daemon/logind/logind.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/daemon/logind/logind.c b/daemon/logind/logind.c
index d322e16c..3e411e02 100644
--- a/daemon/logind/logind.c
+++ b/daemon/logind/logind.c
@@ -1117,8 +1117,12 @@ client_cb(int fd, short event, void *arg)
if ( (len = read(fd, buf, sizeof(buf))) <= 0)
{
- if (errno == EINTR || errno == EAGAIN)
- return;
+ // case to continue:
+ if ((len < 0) && (errno == EINTR || errno == EAGAIN))
+ return;
+
+ // len == 0: EOF
+ // len < 0: any other error.
// close connection
login_conn_remove(conn, fd, 0);