From b2679f57e2150b7313cfe9b4ad2abe95cb752f87 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 13 Feb 2014 08:50:02 +0000
Subject: [PATCH] Fixed to make it build on Win32. Spying doesn't work since
 the current code only uses UNIX-domain sockets.

---
 src/sbbs3/umonitor/chat.c     |  2 +-
 src/sbbs3/umonitor/spyon.c    | 14 ++++++++++++--
 src/sbbs3/umonitor/umonitor.c |  4 ++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/sbbs3/umonitor/chat.c b/src/sbbs3/umonitor/chat.c
index 5a761553b1..cff02704ee 100644
--- a/src/sbbs3/umonitor/chat.c
+++ b/src/sbbs3/umonitor/chat.c
@@ -36,8 +36,8 @@
  ****************************************************************************/
 
 #include <sys/types.h>
-#include <utime.h>
 
+#include <genwrap.h>
 #include "ciolib.h"
 #define __COLORS
 #include "sbbs.h"
diff --git a/src/sbbs3/umonitor/spyon.c b/src/sbbs3/umonitor/spyon.c
index 6497e9dc33..4797156dfc 100644
--- a/src/sbbs3/umonitor/spyon.c
+++ b/src/sbbs3/umonitor/spyon.c
@@ -35,20 +35,29 @@
  * Note: If this box doesn't appear square, then you need to fix your tabs.	*
  ****************************************************************************/
 
-#include <unistd.h>
 #include <stdlib.h>
 #include "sockwrap.h"	/* Must go before <sys/un.h> */
+#ifndef _WIN32
 #include <sys/un.h>
+#endif
 #include <stdio.h>
 #include <string.h>
-#include "sockwrap.h"
+
+#include <genwrap.h>
+#include <sockwrap.h>
 #include "spyon.h"
 #include "ciolib.h"
 #include "cterm.h"
+#include "uifc.h"
 
 struct cterminal *cterm;
+extern uifcapi_t uifc; /* User Interface (UIFC) Library API */
 
 int spyon(char *sockname)  {
+#if defined _WIN32
+	uifc.msg("Spying not supported on Win32 yet!");
+	return SPY_SOCKETLOST;
+#else
 	SOCKET		spy_sock=INVALID_SOCKET;
 	struct sockaddr_un spy_name;
 	socklen_t	spy_len;
@@ -160,5 +169,6 @@ int spyon(char *sockname)  {
 	textattr(ti.attribute);
 	gotoxy(ti.curx,ti.cury);
 	return(retval);
+#endif
 }
 
diff --git a/src/sbbs3/umonitor/umonitor.c b/src/sbbs3/umonitor/umonitor.c
index a7f686965d..ad918ab09f 100644
--- a/src/sbbs3/umonitor/umonitor.c
+++ b/src/sbbs3/umonitor/umonitor.c
@@ -38,12 +38,10 @@
 #include <signal.h>
 #include <sys/types.h>
 #include <time.h>
-#include <sys/time.h>
 #ifdef __QNX__
 #include <string.h>
 #endif
 #include <stdio.h>
-#include <unistd.h>
 
 #include "ciolib.h"
 #define __COLORS		/* Disable the colour macros in sbbsdefs.h ToDo */
@@ -934,7 +932,9 @@ int main(int argc, char** argv)  {
            }
     }
 
+#ifdef SIGPIPE
 	signal(SIGPIPE, SIG_IGN);
+#endif
 
 	uifc.size=sizeof(uifc);
 	i=initciolib(ciolib_mode);
-- 
GitLab