From 4285d0cfe067711ce0614f49d96f61c7c60d5aff Mon Sep 17 00:00:00 2001 Message-Id: <4285d0cfe067711ce0614f49d96f61c7c60d5aff.1715877039.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 4 May 2020 19:26:42 +0100 Subject: [PATCH] lib/uaudio-rtp.c: Fix initial values for socket descriptors. Organization: Straylight/Edgeware From: Mark Wooding The code in `rtp_stop' checks for the sentinel value -1 when trying to close sockets. Without this, it might get (and then ignore!) a spurious `EBADF' when shutting down. --- lib/uaudio-rtp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/uaudio-rtp.c b/lib/uaudio-rtp.c index 7451136..2efd910 100644 --- a/lib/uaudio-rtp.c +++ b/lib/uaudio-rtp.c @@ -55,10 +55,12 @@ static int rtp_payload; /** @brief RTP output socket */ -static int rtp_fd; +static int rtp_fd = -1; /** @brief RTP output socket (IPv6) */ static int rtp_fd6; +/** @brief RTP unicast output socket (IPv6) */ +static int rtp_fd6 = -1; /** @brief RTP SSRC */ static uint32_t rtp_id; -- [mdw]