From 99d31eabf4a3afa4fd54782cc1d7cd92fbdae084 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 8 Dec 2019 02:27:04 +0100 Subject: Cleanup rtmidi data structures --- backends/rtpmidi.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'backends/rtpmidi.c') diff --git a/backends/rtpmidi.c b/backends/rtpmidi.c index 5387d86..ea97565 100644 --- a/backends/rtpmidi.c +++ b/backends/rtpmidi.c @@ -7,6 +7,7 @@ #include #include +#include "libmmbackend.h" #include "rtpmidi.h" #define BACKEND_NAME "rtpmidi" @@ -65,7 +66,9 @@ static int rtpmidi_configure(char* option, char* value){ return 1; } - if(mmbackend_parse_hostspec(value, &host, &port)){ + mmbackend_parse_hostspec(value, &host, &port); + + if(!host){ fprintf(stderr, "Not a valid mDNS bind address: %s\n", value); return 1; } @@ -164,13 +167,5 @@ static int rtpmidi_shutdown(){ close(cfg.mdns_fd); } - for(u = 0; u < cfg.nfds; u++){ - if(cfg.fds[u].data >= 0){ - close(cfg.fds[u].data); - } - if(cfg.fds[u].control >= 0){ - close(cfg.fds[u].control); - } - } return 0; } -- cgit v1.2.3