From 80b970bd29093a1e3e3b5fdeacda4958721a5afd Mon Sep 17 00:00:00 2001 From: Jacek Wuwer Date: Tue, 9 Jan 2024 11:23:56 +0100 Subject: [PATCH] jtag/vdebug: fix socket options on CYGWIN the socket option RCVLOWAT is not supported on CYGWIN. implemented ifdef __CYGWIN not to set this option. Change-Id: I9f6e81fa98ecf5261ea286deb4675658aae59b8e Signed-off-by: Jacek Wuwer Reviewed-on: https://review.openocd.org/c/openocd/+/8066 Tested-by: jenkins Reviewed-by: Ian Thompson Reviewed-by: Antonio Borneo --- src/jtag/drivers/vdebug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jtag/drivers/vdebug.c b/src/jtag/drivers/vdebug.c index d2311b2ea..d51d248bf 100644 --- a/src/jtag/drivers/vdebug.c +++ b/src/jtag/drivers/vdebug.c @@ -53,7 +53,7 @@ #include "helper/log.h" #include "helper/list.h" -#define VD_VERSION 46 +#define VD_VERSION 47 #define VD_BUFFER_LEN 4024 #define VD_CHEADER_LEN 24 #define VD_SHEADER_LEN 16 @@ -253,6 +253,11 @@ static int vdebug_socket_open(char *server_addr, uint32_t port) hsock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); if (hsock == INVALID_SOCKET) rc = vdebug_socket_error(); +#elif defined __CYGWIN__ + /* SO_RCVLOWAT unsupported on CYGWIN */ + hsock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); + if (hsock < 0) + rc = errno; #else uint32_t rcvwat = VD_SHEADER_LEN; /* size of the rcv header, as rcv min watermark */ hsock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);