From 9305008ba8886ad40576124dce06b642445f8eba Mon Sep 17 00:00:00 2001 From: Keith Gable Date: Sun, 24 Sep 2023 12:32:10 -0700 Subject: [PATCH] Tolerate XRDP_ENABLE_VSOCK being defined but the platform is neither FreeBSD nor Linux --- common/os_calls.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/os_calls.c b/common/os_calls.c index 1bd86a633..a58051a5e 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -601,6 +601,9 @@ g_sck_vsock_socket(void) #elif defined(__FreeBSD__) LOG(LOG_LEVEL_DEBUG, "g_sck_vsock_socket: returning FreeBSD Hyper-V socket"); return socket(AF_HYPERV, SOCK_STREAM, 0); // docs say to use AF_HYPERV here - PF_HYPERV does not exist +#else + LOG(LOG_LEVEL_DEBUG, "g_sck_vsock_socket: vsock enabled at compile time, but platform is unsupported"); + return -1; #endif #else LOG(LOG_LEVEL_DEBUG, "g_sck_vsock_socket: vsock disabled at compile time"); @@ -1086,6 +1089,8 @@ g_sck_vsock_bind(int sck, const char *port) s.hvs_port = atoi(port); return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_hvs)); +#else + return -1; #endif #else return -1; @@ -1115,6 +1120,8 @@ g_sck_vsock_bind_address(int sck, const char *port, const char *address) // channel/address currently unsupported in FreeBSD 13. return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_hvs)); +#else + return -1; #endif #else return -1;