changeset 1950:417e0fc958cc

Fix non-Windows build break from Windows compat changes
author Michael Pavone <pavone@retrodev.com>
date Thu, 30 Apr 2020 23:18:50 -0700
parents 5a76a7373823
children 8494fe8d6b65
files util.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util.c	Thu Apr 30 23:15:50 2020 -0700
+++ b/util.c	Thu Apr 30 23:18:50 2020 -0700
@@ -441,6 +441,10 @@
 	exit(1);
 }
 
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+
 void warning(char *format, ...)
 {
 	va_list args;
@@ -722,7 +726,6 @@
 
 #else
 #include <fcntl.h>
-#include <unistd.h>
 
 void socket_init(void)
 {
@@ -730,7 +733,7 @@
 
 int socket_blocking(int sock, int should_block)
 {
-	if (fcntl(listen_sock, F_SETFL, should_block ? 0 : O_NONBLOCK)) {
+	if (fcntl(sock, F_SETFL, should_block ? 0 : O_NONBLOCK)) {
 		return errno;
 	}
 	return 0;