From 573b1e68fe94dbb746bdb59f5034577411f9504c Mon Sep 17 00:00:00 2001 From: Teuniz Date: Fri, 12 Mar 2021 09:51:01 +0100 Subject: [PATCH] Added a bit more diagnostic info in case of a LAN send error. --- global.h | 2 +- tmc_lan.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/global.h b/global.h index 4d65d83..c0e6147 100644 --- a/global.h +++ b/global.h @@ -35,7 +35,7 @@ #define PROGRAM_NAME "DSRemote" -#define PROGRAM_VERSION "0.37_2102171920" +#define PROGRAM_VERSION "0.37_2103120950" #define MAX_PATHLEN 1024 diff --git a/tmc_lan.c b/tmc_lan.c index 2c4c3fe..248f5c2 100644 --- a/tmc_lan.c +++ b/tmc_lan.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "tmc_dev.h" #include "utils.h" @@ -79,9 +80,19 @@ static int tmclan_send(const char *str) { if(FD_ISSET(sockfd, &temp_tcp_fds)) /* check if our file descriptor is set */ { - return send(sockfd, str, len, MSG_NOSIGNAL); + len = send(sockfd, str, len, MSG_NOSIGNAL); + if(len == -1) + { + perror("send()"); + } + + return len; } } + else + { + perror("select()"); + } return -1; }