Index: pjproject/main/configure
===================================================================
--- pjproject/main/configure	(revision 27)
+++ pjproject/main/configure	(revision 28)
@@ -28,4 +28,15 @@
     OS_NAME=linux
     HOST_NAME=unix
+    # More on linux version
+    KERNEL_VER=`uname -r`
+    if echo $KERNEL_VER | grep '^2\.4' > /dev/null; then
+	LINUX_POLL=select
+    elif echo $KERNEL_VER | grep '^2\.2' > /dev/null; then
+	LINUX_POLL=select
+    elif echo $KERNEL_VER | grep '^2\.0' > /dev/null; then
+	LINUX_EPOLL=select
+    else
+	LINUX_POLL=epoll
+    fi
 elif echo $SYSTEM | grep -i mingw > /dev/null; then
     OS_NAME=win32
@@ -55,8 +66,9 @@
 
 echo 'Writing build.mak as follows:'
-echo " MACHINE_NAME=$MACHINE_NAME"
-echo " OS_NAME=$OS_NAME"
-echo " HOST_NAME=$HOST_NAME"
-echo " CC_NAME=$CC_NAME"
+echo " MACHINE_NAME = $MACHINE_NAME"
+echo " OS_NAME      = $OS_NAME"
+echo " HOST_NAME    = $HOST_NAME"
+echo " CC_NAME      = $CC_NAME"
+echo " LINUX_POLL   = $LINUX_POLL"
 
 echo "# Auto-generated build.mak" > build.mak
@@ -65,4 +77,8 @@
 echo "export HOST_NAME := $HOST_NAME" >> build.mak
 echo "export CC_NAME := $CC_NAME" >> build.mak
+echo "export LINUX_POLL := $LINUX_POLL" >> build.mak
+
+echo
+echo "You may review build.mak if you wish"
 echo "Done."
 
Index: pjproject/main/pjlib/build/os-linux.mak
===================================================================
--- pjproject/main/pjlib/build/os-linux.mak	(revision 27)
+++ pjproject/main/pjlib/build/os-linux.mak	(revision 28)
@@ -15,6 +15,9 @@
 			pool_policy_malloc.o sock_bsd.o sock_select.o
 
-#export PJLIB_OBJS += ioqueue_select.o 
+ifeq (epoll,$(LINUX_POLL))
 export PJLIB_OBJS += ioqueue_epoll.o
+else
+export PJLIB_OBJS += ioqueue_select.o 
+endif
 
 export PJLIB_OBJS += file_access_unistd.o file_io_ansi.o
Index: pjproject/main/pjlib/src/pj/ioqueue_common_abs.c
===================================================================
--- pjproject/main/pjlib/src/pj/ioqueue_common_abs.c	(revision 27)
+++ pjproject/main/pjlib/src/pj/ioqueue_common_abs.c	(revision 28)
@@ -169,9 +169,10 @@
 	 * successfully (if SO_ERROR is zero).
 	 */
-	int value;
-	socklen_t vallen = sizeof(value);
-	int gs_rc = getsockopt(h->fd, SOL_SOCKET, SO_ERROR, 
+	{
+	  int value;
+	  socklen_t vallen = sizeof(value);
+	  int gs_rc = getsockopt(h->fd, SOL_SOCKET, SO_ERROR, 
                                &value, &vallen);
-	if (gs_rc != 0) {
+	  if (gs_rc != 0) {
 	    /* Argh!! What to do now??? 
 	     * Just indicate that the socket is connected. The
@@ -180,7 +181,8 @@
 	     */
 	    bytes_transfered = 0;
-	} else {
+	  } else {
             bytes_transfered = value;
-	}
+	  }
+ 	}
 #elif defined(PJ_WIN32) && PJ_WIN32!=0
 	bytes_transfered = 0; /* success */
Index: pjproject/main/pjlib/src/pjlib-test/exception.c
===================================================================
--- pjproject/main/pjlib/src/pjlib-test/exception.c	(revision 27)
+++ pjproject/main/pjlib/src/pjlib-test/exception.c	(revision 28)
@@ -141,6 +141,8 @@
 
     for (i=0; i<LOOP; ++i) {
-	if ((rc=test()) != 0)
+	if ((rc=test()) != 0) {
+	    PJ_LOG(3,("", "...failed at i=%d (rc=%d)", i, rc));
 	    return rc;
+	}
     }
     return 0;
Index: pjproject/main/pjlib/src/pjlib-test/test.h
===================================================================
--- pjproject/main/pjlib/src/pjlib-test/test.h	(revision 27)
+++ pjproject/main/pjlib/src/pjlib-test/test.h	(revision 28)
@@ -6,9 +6,9 @@
 #include <pj/types.h>
 
-#define GROUP_LIBC                  0
-#define GROUP_OS                    0
-#define GROUP_DATA_STRUCTURE        0
-#define GROUP_NETWORK               0
-#define GROUP_FILE                  0
+#define GROUP_LIBC                  1
+#define GROUP_OS                    1
+#define GROUP_DATA_STRUCTURE        1
+#define GROUP_NETWORK               1
+#define GROUP_FILE                  1
 #define GROUP_EXTRA                 0
 
@@ -38,5 +38,5 @@
 
 #define INCLUDE_ECHO_SERVER         0
-#define INCLUDE_ECHO_CLIENT         1
+#define INCLUDE_ECHO_CLIENT         0
 
 
