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 <jacekmw8@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8066
Tested-by: jenkins
Reviewed-by: Ian Thompson <ianst@cadence.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Jacek Wuwer 2024-01-09 11:23:56 +01:00 committed by Antonio Borneo
parent 987a274a85
commit 80b970bd29
1 changed files with 6 additions and 1 deletions

View File

@ -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);