diff --git a/tests/ampctld.c b/tests/ampctld.c index 2582bb55a..35d866247 100644 --- a/tests/ampctld.c +++ b/tests/ampctld.c @@ -680,6 +680,8 @@ void *handle_socket(void *arg) handle_exit: #ifdef __MINGW32__ closesocket(handle_data_arg->sock); +#else + close(handle_data_arg->sock); #endif free(arg); diff --git a/tests/rigctld.c b/tests/rigctld.c index d65966484..8d5dc2962 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -1043,6 +1043,14 @@ handle_exit: fclose(fsockin); fclose(fsockout); +// for everybody else we close the handle after fclose +#ifndef __MINGW32__ + retcode = close(handle_data_arg->sock); + + if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: close(handle_data_arg->sock) %s\n", __func__, strerror(retcode)); } + +#endif + free(arg); #ifdef HAVE_PTHREAD diff --git a/tests/rotctld.c b/tests/rotctld.c index 7ec506199..84e2e00ba 100644 --- a/tests/rotctld.c +++ b/tests/rotctld.c @@ -693,6 +693,8 @@ void *handle_socket(void *arg) handle_exit: #ifdef __MINGW32__ closesocket(handle_data_arg->sock); +#else + close(handle_data_arg->sock); #endif free(arg);