From: Mark Wooding Date: Mon, 4 May 2020 18:30:39 +0000 (+0100) Subject: lib/uaudio-rtp.c: Squidge up the socket-closing code. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/2301e9152786b4ec72c8cbf649901e01b23ba5df?hp=4285d0cfe067711ce0614f49d96f61c7c60d5aff lib/uaudio-rtp.c: Squidge up the socket-closing code. I plan to add another one, and the commonality in the code gets lost if it's written out vertically. --- diff --git a/lib/uaudio-rtp.c b/lib/uaudio-rtp.c index 2efd910..825018e 100644 --- a/lib/uaudio-rtp.c +++ b/lib/uaudio-rtp.c @@ -448,12 +448,8 @@ static void rtp_start(uaudio_callback *callback, static void rtp_stop(void) { uaudio_thread_stop(); - close(rtp_fd); - rtp_fd = -1; - if(rtp_fd6 >= 0) { - close(rtp_fd6); - rtp_fd6 = -1; - } + close(rtp_fd); rtp_fd = -1; + if(rtp_fd6 >= 0) { close(rtp_fd6); rtp_fd6 = -1; } } static void rtp_configure(void) {