$NetBSD: patch-ac,v 1.3 2006/07/03 02:18:15 tron Exp $

--- libhttpd/src/select.h.orig	2006-03-05 14:00:38.000000000 +0000
+++ libhttpd/src/select.h	2006-07-03 03:10:45.000000000 +0100
@@ -81,7 +81,7 @@
 			c++;
 		}
 	
-		return 0;
+		return c;
 	}
 
 
@@ -154,7 +154,7 @@
 	
 	void erase( const int fDesc ) {
 		ClientIterator c;
-		if ((c = locateFDesc(fDesc)) != 0) {
+		if ((c = locateFDesc(fDesc)) != clientList.end()) {
 			clientList.erase(c);
 			close(fDesc);
 		}
@@ -162,14 +162,14 @@
 
 	void finish( const int fDesc ) {
 		ClientIterator c;
-		if ((c = locateFDesc(fDesc)) != 0) {
+		if ((c = locateFDesc(fDesc)) != clientList.end()) {
 			c->finished = true;
 		}
 	}
 
 	void address( const int fDesc, char address[HTTP_IP_ADDR_LEN] ) {
 		ClientIterator c;
-		if ((c = locateFDesc(fDesc)) != 0) {
+		if ((c = locateFDesc(fDesc)) != clientList.end()) {
 			strncpy(address, c->address, HTTP_IP_ADDR_LEN);
 		}
 	}
@@ -180,7 +180,7 @@
 
 	int readBuf(const int fDesc, char *destBuf, const uint len) {
 		ClientIterator c;
-		if ((c = locateFDesc(fDesc)) == 0) {
+		if ((c = locateFDesc(fDesc)) == clientList.end()) {
 			// printf("unknown client id %d\n", fDesc);
 			return 0;
 		}
@@ -192,7 +192,7 @@
 		
 	int readLine(const int fDesc, char *destBuf, const uint len) {
 		ClientIterator c;
-		if ((c = locateFDesc(fDesc)) == 0) {
+		if ((c = locateFDesc(fDesc)) == clientList.end()) {
 			// printf("unknown client id %d\n", fDesc);
 			return 0;
 		}
@@ -217,7 +217,7 @@
 	int handleWrite(int socket) {
 		int bytesWritten;
 		ClientIterator c;
-		if ((c = locateFDesc(socket)) == 0) {
+		if ((c = locateFDesc(socket)) == clientList.end()) {
 			// printf("unknown client id %d\n", socket);
 			return 2;
 		}
@@ -260,7 +260,7 @@
 			return 1;
 		} else {
 			ClientIterator c;
-			if ((c = locateFDesc(fDesc)) == 0) {
+			if ((c = locateFDesc(fDesc)) == clientList.end()) {
 				// printf("unknown client id %d\n", fDesc);
 				return 2;
 			}
@@ -304,7 +304,7 @@
 	
 	void doWrite(const int fDesc, const char* string, const uint len) {
 		ClientIterator c;
-		if ((c = locateFDesc(fDesc)) == 0) {
+		if ((c = locateFDesc(fDesc)) == clientList.end()) {
 			//printf("unknown client id %d\n", fDesc);
 			return;
 		}
@@ -318,7 +318,7 @@
 
 	void doWrite(const int fDesc, const char* string) {
 		ClientIterator c;
-		if ((c = locateFDesc(fDesc)) == 0) {
+		if ((c = locateFDesc(fDesc)) == clientList.end()) {
 			//printf("unknown client id %d\n", fDesc);
 			return;
 		}
@@ -351,7 +351,7 @@
 
 	void queueFile(const int socket, const int pendingFile ) {
 		ClientIterator c;
-		if ((c = locateFDesc(socket)) == 0) {
+		if ((c = locateFDesc(socket)) == clientList.end()) {
 			// printf("unknown client id %d\n", socket);
 			return;
 		}
@@ -360,7 +360,7 @@
 
 	void subscribe(const int fDesc) {
 		ClientIterator c;
-		if ((c = locateFDesc(fDesc)) == 0) {
+		if ((c = locateFDesc(fDesc)) == clientList.end()) {
 			//printf("unknown client id %d\n", fDesc);
 			return;
 		}
