Don't compile support for Device=fd on platforms that do not support UNIX sockets.
[tinc] / src / net_setup.c
index 7d88c32..1f0e74c 100644 (file)
@@ -222,7 +222,7 @@ static bool read_ecdsa_private_key(void) {
                return false;
        }
 
-#if !defined(HAVE_MINGW) && !defined(HAVE_CYGWIN)
+#ifndef HAVE_MINGW
        struct stat s;
 
        if(fstat(fileno(fp), &s)) {
@@ -314,7 +314,7 @@ static bool read_rsa_private_key(void) {
                return false;
        }
 
-#if !defined(HAVE_MINGW) && !defined(HAVE_CYGWIN)
+#ifndef HAVE_MINGW
        struct stat s;
 
        if(fstat(fileno(fp), &s)) {
@@ -1053,10 +1053,14 @@ static bool setup_myself(void) {
                        devops = raw_socket_devops;
                } else if(!strcasecmp(type, "multicast")) {
                        devops = multicast_devops;
-               } else if(!strcasecmp(type, "fd")) {
+               }
+
+#ifdef HAVE_SYS_UN_H
+               else if(!strcasecmp(type, "fd")) {
                        devops = fd_devops;
                }
 
+#endif
 #ifdef ENABLE_UML
                else if(!strcasecmp(type, "uml")) {
                        devops = uml_devops;