From 5ac64fbd2b6e934c21b3e969ca934998deed473d Mon Sep 17 00:00:00 2001 From: Andreas Haschka Date: Mon, 1 Jul 2019 16:21:54 +0200 Subject: [PATCH 1/2] =?UTF-8?q?fix=20artnet-usb.c=20compile=20error=20on?= =?UTF-8?q?=20newer=20gcc=20(=E2=80=98for=E2=80=99=20clause=20does=20not?= =?UTF-8?q?=20guard...=20[-Werror=3Dmisleading-indentation])?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/artnet-usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/artnet-usb.c b/src/artnet-usb.c index a007b56..0ec150d 100644 --- a/src/artnet-usb.c +++ b/src/artnet-usb.c @@ -196,8 +196,8 @@ int load_config(opts_t *ops) { continue ; // strip \n - for(c = buf ; *c != '\n' ; c++) ; - *c = '\0' ; + for(c = buf ; *c != '\n' ; c++) {}; + *c = '\0' ; key = strtok(buf, "=") ; data = strtok(NULL, "=") ; From 89edb8ea3c7420807669891f7ed709e2a8b0e161 Mon Sep 17 00:00:00 2001 From: Andreas Haschka Date: Mon, 1 Jul 2019 16:22:25 +0200 Subject: [PATCH 2/2] artnet-firmware-server: fix select() not triggering on network file descriptor, correctly set uploading flag when sending firmware --- src/artnet-firmware-server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/artnet-firmware-server.c b/src/artnet-firmware-server.c index 62b3fc8..2c4268a 100644 --- a/src/artnet-firmware-server.c +++ b/src/artnet-firmware-server.c @@ -239,8 +239,10 @@ int server_handle_input(artnet_node n, options_t *options) { break; } - if(ent != NULL) + if(ent != NULL) { + options->uploading = 1; artnet_send_firmware(n, ent, options->ubea, options->buffer, options->size / sizeof(uint16_t), firmware_complete_callback, (void *) options); + } } else { printf("Invalid Command\n"); @@ -259,7 +261,7 @@ void wait_for_input(artnet_node n, options_t *options) { struct timeval tv; sd = artnet_get_sd(n); - maxsd = sd; + maxsd = sd + 1; while(1) { FD_ZERO(&rset); @@ -289,7 +291,6 @@ void wait_for_input(artnet_node n, options_t *options) { } } } - int main(int argc, char *argv[]) { artnet_node node; options_t options;