$NetBSD$

--- tac_plus.c.orig	2000-12-18 17:58:02.000000000 +0100
+++ tac_plus.c	2008-10-04 21:54:02.000000000 +0200
@@ -23,8 +23,9 @@
 */
 
 #include "tac_plus.h"
-#include "sys/wait.h"
-#include "signal.h"
+#include <sys/wait.h>
+#include <signal.h>
+#include <stdlib.h> /* for exit() */
 
 static int standalone  = 1; /* running standalone (1) or under inetd (0) */
 static int initialised = 0; /* data structures have been allocated */
@@ -116,7 +117,7 @@
 #ifdef REARMSIGNAL
     signal(SIGUSR1, handler);
     signal(SIGHUP, handler);
-#endif REARMSIGNAL
+#endif /* REARMSIGNAL */
 }
 
 /*
@@ -350,11 +351,11 @@
 
 #ifndef REAPCHILD
 
-#ifdef LINUX
+#if defined(LINUX) || defined(__sgi) || defined(MACOSX5PLUS)
 	if (setpgrp() == -1)
-#else /* LINUX */
+#else /* LINUX or IRIX or MacOS 10.5 or later */
 	if (setpgrp(0, getpid()) == -1)
-#endif /* LINUX */
+#endif /* LINUX or IRIX */
 	    report(LOG_ERR, "Can't change process group");
 	
 	c = open("/dev/tty", O_RDWR);
