Common subdirectories: esound-0.2.38.orig//docs and esound-0.2.38//docs
diff -up esound-0.2.38.orig//esdlib.c esound-0.2.38//esdlib.c
--- esound-0.2.38.orig//esdlib.c	2008-07-10 10:10:31.000000000 -0400
+++ esound-0.2.38//esdlib.c	2008-07-10 10:32:23.000000000 -0400
@@ -20,9 +20,11 @@
 #include <arpa/inet.h>
 #include <errno.h>
 #include <sys/wait.h>
+#include <poll.h>
 
 #include <sys/un.h>
 
+
 #ifndef SUN_LEN
 #define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path)  \
                      + strlen ((ptr)->sun_path))
@@ -408,6 +410,43 @@ int esd_resume( int esd )
     return ok;
 }
 
+static int
+connect_timeout (int sockfd, const struct sockaddr *serv_addr, size_t addrlen, int timeout)
+{
+	struct pollfd pfd[1];
+	int flags, rv;
+	
+	if ((flags = fcntl (sockfd, F_GETFL)) == -1)
+		return -1;
+	
+	fcntl (sockfd, F_SETFL, flags | O_NONBLOCK);
+	
+	if (connect (sockfd, serv_addr, addrlen) == 0) {
+		fcntl (sockfd, F_SETFL, flags);
+		return 0;
+	}
+	
+	if (errno != EINPROGRESS)
+		return -1;
+	
+	pfd[0].fd = sockfd;
+	pfd[0].events = POLLIN | POLLOUT;
+	
+	do {
+		pfd[0].revents = 0;
+		rv = poll (pfd, 1, timeout);
+	} while (rv == -1 && errno == EINTR);
+	
+	if (pfd[0].revents & (POLLIN | POLLOUT)) {
+		/* success, we are now connected */
+		fcntl (sockfd, F_SETFL, flags);
+		return 0;
+	}
+	
+	/* took too long / error connecting, either way: epic fail */
+	return -1;
+}
+
 /**
  * esd_connect_tcpip: make a TCPIP connection to ESD
  * @host: specifies hostname and port to connect to as "hostname:port"
@@ -512,7 +551,7 @@ esd_connect_tcpip(const char *host)
            goto error_out;
          }
 
-         if ( connect( socket_out, res->ai_addr, res->ai_addrlen ) != -1 ) 
+         if ( connect_timeout ( socket_out, res->ai_addr, res->ai_addrlen, 1000 ) != -1 ) 
            break;
 
          close ( socket_out );
@@ -596,9 +635,9 @@ esd_connect_tcpip(const char *host)
     socket_addr.sin_family = AF_INET;
     socket_addr.sin_port = htons( port );
   
-    if ( connect( socket_out,
-		  (struct sockaddr *) &socket_addr,
-		  sizeof(struct sockaddr_in) ) < 0 )
+    if ( connect_timeout ( socket_out,
+			   (struct sockaddr *) &socket_addr,
+			   sizeof(struct sockaddr_in), 1000 ) < 0 )
 	goto error_out;
 
     }
@@ -650,8 +689,7 @@ esd_connect_unix(void)
     socket_unix.sun_family = AF_UNIX;
     strncpy(socket_unix.sun_path, ESD_UNIX_SOCKET_NAME, sizeof(socket_unix.sun_path));
   
-    if ( connect( socket_out,
-		  (struct sockaddr *) &socket_unix, SUN_LEN(&socket_unix) ) < 0 )
+    if ( connect_timeout ( socket_out, (struct sockaddr *) &socket_unix, SUN_LEN(&socket_unix), 100 ) < 0 )
 	goto error_out;
   
     return socket_out;
Common subdirectories: esound-0.2.38.orig//m4 and esound-0.2.38//m4
