From 1b89407a8d64a6895f935afc8dec8f032336be16 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 24 Jan 2021 17:19:58 -0600 Subject: [PATCH] Fix compilation of rigctld.c on mingw --- tests/rigctld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/rigctld.c b/tests/rigctld.c index 7e74f03b3..bd33cb8fc 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -972,6 +972,7 @@ int main(int argc, char *argv[]) static FILE*get_fsockout(struct handle_data *handle_data_arg) { #ifdef __MINGW32__ + int sock_osfhandle = _open_osfhandle(handle_data_arg->sock, _O_RDONLY); return _fdopen(sock_osfhandle, "wb"); #else return fdopen(handle_data_arg->sock, "wb"); @@ -986,7 +987,7 @@ static FILE* get_fsockin(struct handle_data *handle_data_arg) if (sock_osfhandle == -1) { rig_debug(RIG_DEBUG_ERR, "_open_osfhandle error: %s\n", strerror(errno)); - goto handle_exit; + return NULL; } return _fdopen(sock_osfhandle, "rb");