summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2020-04-30 23:18:50 -0700
committerMichael Pavone <pavone@retrodev.com>2020-04-30 23:18:50 -0700
commit057f050ce33497704fabfac5e9e7650fe2d4e73e (patch)
tree4008ef0df751858227ccba912a5db017bbca421f
parent2b6dcd8e9058ceb6ea32a04aa1e1d4a13d682529 (diff)
Fix non-Windows build break from Windows compat changes
-rw-r--r--util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/util.c b/util.c
index 848fca4..4962b52 100644
--- a/util.c
+++ b/util.c
@@ -441,6 +441,10 @@ void fatal_error(char *format, ...)
exit(1);
}
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+
void warning(char *format, ...)
{
va_list args;
@@ -722,7 +726,6 @@ int socket_error_is_wouldblock(void)
#else
#include <fcntl.h>
-#include <unistd.h>
void socket_init(void)
{
@@ -730,7 +733,7 @@ void socket_init(void)
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;