[Spice-devel] [PATCH 3/3] Fix setsockopt on FreeBSD

Roman Bogorodskiy bogorodskiy at gmail.com
Sat Apr 17 08:52:11 UTC 2021


FreeBSD's setsockopt() behaves just like Dawrin, i.e. sets errno to
EINVAL instead of ENOTSUP, so extend the Darwin workaround to work for
FreeBSD as well.

Signed-off-by: Roman Bogorodskiy <bogorodskiy at gmail.com>
---
 server/net-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/net-utils.c b/server/net-utils.c
index e9778e73..7cad5342 100644
--- a/server/net-utils.c
+++ b/server/net-utils.c
@@ -48,7 +48,7 @@
 static inline bool
 darwin_einval_on_unix_socket(int fd, int err)
 {
-#if defined(__APPLE__)
+#if defined(__APPLE__) || defined(__FreeBSD__)
     if (err == EINVAL) {
         union {
             struct sockaddr sa;
-- 
2.30.1



More information about the Spice-devel mailing list