summaryrefslogtreecommitdiff
path: root/x11/xphoon/patches/patch-ac
blob: 3bec9499f7f0b01af7553036375d24c6b340ebc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$NetBSD: patch-ac,v 1.1.1.1 2001/07/18 14:27:31 nra Exp $

--- xphoon.c.orig	Wed Sep 18 21:57:37 1991
+++ xphoon.c
@@ -31,9 +31,16 @@
 
 /* Externals. */
 
+#include <sys/param.h>
+
+#if (defined(BSD) && (BSD >= 199306))
+#include <stdlib.h>
+#include <time.h>
+#else
 extern char* malloc();
 extern long time();
 extern long random();
+#endif
 
 extern void getbits();
 extern double jtime();
@@ -65,7 +72,7 @@
     int blackflag, demoflag;
     int printpid;
     char* display_name;
-    long clock;
+    time_t clock;
     int pid, tty;
     int size;
     char* mooncopy;
@@ -190,6 +197,7 @@
 	(void) fflush( stdout );
 
 	/* Go stealth (ditch our controlling tty). */
+#ifdef TIOCNOTTY
 	tty = open( "/dev/tty", 0 );
 	if ( tty < 0 )
 	    {
@@ -207,6 +215,9 @@
 		}
 	    (void) close( tty );
 	    }
+#else
+	setsid();
+#endif
 	}
 
     size = BitmapSize( moon_w, moon_h );