]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
prevent run_this_before_play_begins or run_this_after_play_ends holding the RTSP...
authorMike Brady <mikebrady@eircom.net>
Mon, 27 Jun 2016 20:05:37 +0000 (21:05 +0100)
committerMike Brady <mikebrady@eircom.net>
Mon, 27 Jun 2016 20:05:37 +0000 (21:05 +0100)
configure.ac
rtsp.c

index 5ce74af8ba3522ed41399e435c46b4a972f1827e..32e50ed458852b3e32e78d01fc3d2866378dfc29 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.50])
-AC_INIT([shairport-sync], [2.8.4.2], [mikebrady@eircom.net])
+AC_INIT([shairport-sync], [2.8.4.3], [mikebrady@eircom.net])
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([shairport.c])
 AC_CONFIG_HEADERS([config.h])
diff --git a/rtsp.c b/rtsp.c
index cf94c52d6f845a59a4ab725e7562089c450d7c5b..6e08cf32368372310963af6631c7453aa784180c 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -1838,6 +1838,12 @@ void rtsp_listen_loop(void) {
       // strerror(errno));
       continue;
     }
+    // Set the RTSP socket to close on exec() of child processes
+    // otherwise background run_this_before_play_begins or run_this_after_play_ends commands
+    // that are sleeping prevent the daemon from being restarted because
+    // the listening RTSP port is still in use.
+    // See: https://github.com/mikebrady/shairport-sync/issues/329
+    fcntl(fd, F_SETFD, FD_CLOEXEC);
     ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));
 
 #ifdef IPV6_V6ONLY