]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add some information to message if the listening port (normally port 5000) is already...
authorMike Brady <mikebrady@eircom.net>
Wed, 11 May 2016 09:08:10 +0000 (09:08 +0000)
committerMike Brady <mikebrady@eircom.net>
Wed, 11 May 2016 09:08:10 +0000 (09:08 +0000)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index a6e4992a6d3a5970a23dd8d8d4d72c0f78632c95..ac707db1777a92c47b2892c62d88dcde47c9f288 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -1819,6 +1819,7 @@ void rtsp_listen_loop(void) {
   }
 
   for (p = info; p; p = p->ai_next) {
+       ret = 0;
     int fd = socket(p->ai_family, p->ai_socktype, IPPROTO_TCP);
     int yes = 1;
 
@@ -1847,7 +1848,14 @@ void rtsp_listen_loop(void) {
     // report its availability. do not complain.
 
     if (ret) {
-      debug(1, "Failed to bind to address %s.", format_address(p->ai_addr));
+       char *family;
+#ifdef AF_INET6
+                       if (p->ai_family == AF_INET6) {
+                       family = "IPv6";
+                       } else
+#endif
+                       family = "IPv4";
+      debug(1, "Unable to listen on %s port %d. The error is: \"%s\".", family, config.port,strerror(errno));
       continue;
     }
 
@@ -1860,7 +1868,7 @@ void rtsp_listen_loop(void) {
   freeaddrinfo(info);
 
   if (!nsock)
-    die("could not bind any listen sockets!");
+    die("Could not listen on port %d -- program terminating. Is another Shairport Sync running?",config.port);
 
   int maxfd = -1;
   fd_set fds;