From: Mark Wooding Date: Mon, 4 May 2020 18:26:42 +0000 (+0100) Subject: lib/uaudio-rtp.c: Fix initial values for socket descriptors. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/4285d0cfe067711ce0614f49d96f61c7c60d5aff?ds=sidebyside lib/uaudio-rtp.c: Fix initial values for socket descriptors. 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. --- 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;