diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-15 01:26:24 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-15 01:26:24 +0800 |
commit | e2b4af20009f9963522b6e31c75b3f79b61f5394 (patch) | |
tree | 07415dbe49f00ae708aac354bfb8b62cd41b4028 /daemon | |
parent | 926e1bd0914dd601923cec7de07dc192e76eda5c (diff) | |
download | pttbbs-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.c | 8 |
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); |