summaryrefslogtreecommitdiff
path: root/games/bsdgames/files/patch-atc_main.c
blob: 3592011afea8616e9d150dac2712f78f31b83aed (plain) (blame)
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
Index: atc/main.c
@@ -173,6 +173,15 @@
 	ioctl(fileno(stdin), TCSETAW, &tty_new);
 #endif
 
+#ifdef POSIX
+	tcgetattr(fileno(stdin), &tty_start);
+	bcopy(&tty_start, &tty_new, sizeof(tty_new));
+	tty_new.c_lflag &= ~ICANON;
+	tty_new.c_lflag &= ~ECHO;
+	tty_new.c_cc[VMIN] = 1;
+	tty_new.c_cc[VTIME] = 0;
+	tcsetattr(fileno(stdin), TCSANOW, &tty_new);
+#endif
 	signal(SIGALRM, update);
 
 #ifdef BSD
@@ -185,6 +194,9 @@
 #ifdef SYSV
 	alarm(sp->update_secs);
 #endif
+#ifdef POSIX
+	alarm(sp->update_secs);
+#endif
 
 	for (;;) {
 		if (getcommand() != 1)
@@ -198,6 +210,9 @@
 #ifdef SYSV
 			alarm(0);
 #endif
+#ifdef POSIX
+			alarm(0);
+#endif
 
 			update();
 
@@ -209,6 +224,9 @@
 			setitimer(ITIMER_REAL, &itv, NULL);
 #endif
 #ifdef SYSV
+			alarm(sp->update_secs);
+#endif
+#ifdef POSIX
 			alarm(sp->update_secs);
 #endif
 		}