diff --git a/src/sbbs3/sbbscon.c b/src/sbbs3/sbbscon.c
index dfd449b705e66fc760ae9e085fa9e3f04bf8c1ba..e02ef07dee25666ab6702cd7f32496070f049b64 100644
--- a/src/sbbs3/sbbscon.c
+++ b/src/sbbs3/sbbscon.c
@@ -822,42 +822,6 @@ void _sighandler_rerun(int sig)
 	services_startup.recycle_now=TRUE;
 }
 
-#ifdef NEEDS_DAEMON
-/****************************************************************************/
-/* Daemonizes the process                                                   */
-/****************************************************************************/
-int
-daemon(nochdir, noclose)
-    int nochdir, noclose;
-{
-    int fd;
-
-    switch (fork()) {
-    case -1:
-        return (-1);
-    case 0:
-        break;
-    default:
-        _exit(0);
-    }
-
-    if (setsid() == -1)
-        return (-1);
-
-    if (!nochdir)
-        (void)chdir("/");
-
-    if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
-        (void)dup2(fd, STDIN_FILENO);
-        (void)dup2(fd, STDOUT_FILENO);
-        (void)dup2(fd, STDERR_FILENO);
-        if (fd > 2)
-            (void)close(fd);
-    }
-    return (0);
-}
-#endif /* NEEDS_DAEMON */
-
 static void handle_sigs(void)  {
 	int			sig;
 	sigset_t	sigs;
diff --git a/src/sbbs3/xtrn.cpp b/src/sbbs3/xtrn.cpp
index 855bd555110fde03b48ca4efcfb1d75e47b6e8cc..e44c521232d972269429642e7b84a8f2cdd9b004 100644
--- a/src/sbbs3/xtrn.cpp
+++ b/src/sbbs3/xtrn.cpp
@@ -1102,6 +1102,41 @@ static int login_tty(int fd)
 	return (0);
 }
 
+#ifdef NEEDS_DAEMON
+/****************************************************************************/
+/* Daemonizes the process                                                   */
+/****************************************************************************/
+int
+daemon(int nochdir, int noclose)
+{
+    int fd;
+
+    switch (fork()) {
+    case -1:
+        return (-1);
+    case 0:
+        break;
+    default:
+        _exit(0);
+    }
+
+    if (setsid() == -1)
+        return (-1);
+
+    if (!nochdir)
+        (void)chdir("/");
+
+    if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
+        (void)dup2(fd, STDIN_FILENO);
+        (void)dup2(fd, STDOUT_FILENO);
+        (void)dup2(fd, STDERR_FILENO);
+        if (fd > 2)
+            (void)close(fd);
+    }
+    return (0);
+}
+#endif
+
 static int openpty(int *amaster, int *aslave, char *name, struct termios *termp, winsize *winp)
 {
 	char line[] = "/dev/ptyXX";