Index: common-src/util.c
===================================================================
RCS file: /cvsroot/amanda/amanda/common-src/util.c,v
retrieving revision 1.2.2.4
diff -u -r1.2.2.4 util.c
--- common-src/util.c	2001/03/20 00:21:06	1.2.2.4
+++ common-src/util.c	2001/04/22 23:32:12
@@ -98,6 +98,7 @@
 {
     int port, cnt;
     const int num_ports = last_port - first_port + 1;
+    int save_errno;
 
     assert(first_port > 0 && first_port <= last_port && last_port < 65536);
 
@@ -124,7 +125,18 @@
 	    port = first_port;
     }
     if (cnt == num_ports) {
+	dbprintf(("%s: bind_portrange: all ports between %d and %d busy\n",
+		  get_pname(),
+		  first_port,
+		  last_port));
 	errno = EAGAIN;
+    } else {
+	save_errno = errno;
+	dbprintf(("%s: bind_portrange: port %d: %s\n",
+		  get_pname(),
+		  port,
+		  strerror(errno)));
+	errno = save_errno;
     }
     return -1;
 }
