--- pnscan-1.11.orig/pnscan.c
+++ pnscan-1.11/pnscan.c
@@ -583,6 +583,19 @@
 	{
 	    code = -1;
 	    errno = ETIMEDOUT;
+	} else {
+            /* Check for pending error. */
+            int error = 0;
+            socklen_t len = sizeof (error);
+
+	    errno = 0;
+            if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) >= 0) {
+                /* non-Solaris case: error is overwritten with errno. */
+                errno = error;
+            }
+            if (errno) {
+                code = -1;
+            }
 	}
     }
     
@@ -630,5 +645,21 @@
 
     if (len < 0)
     {
+        if (errno == ETIMEDOUT) {
+            /* If we timeout during a read, the socket was open, but we
+               received no banner.  This situation is still worthwile
+               to report as an "empty" read result. */
+
+            pthread_mutex_lock(&print_lock);
+
+            print_host(stdout, sin.sin_addr, port);
+            printf(" : TXT : \n");
+
+            pthread_mutex_unlock(&print_lock);
+
+            close(fd);
+            return 1;
+        }   
+
 	if (verbose)
 	{
