summaryrefslogtreecommitdiff
path: root/games/netmaze/patches/patch-ad
blob: 857584b23cebfa3b4fc3dc71bb93bfbb59042cab (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
49
50
51
52
53
54
55
56
57
58
59
60
61
$NetBSD: patch-ad,v 1.3 2013/03/25 01:59:03 dholland Exp $

- use standard headers
- fix void main
- change around handling of signal masks (XXX: it is still wrong)

--- netmaze.c.orig	1994-04-15 20:34:04.000000000 +0000
+++ netmaze.c
@@ -23,16 +23,12 @@
  *
  *********************************************************************/
 
-#ifndef NeXT
-  #include <malloc.h>
-#endif
-
 #include <math.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/signal.h>
+#include <signal.h>
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
@@ -96,7 +92,7 @@ struct sigaction vec,ovec,vecio,ovecio;
 extern struct timeval notimeout;
 extern struct fd_mask readmask;
 
-void main(int argc,char **argv)
+int main(int argc,char **argv)
 {
   int i,nowait=FALSE;
 
@@ -293,6 +289,7 @@ void main(int argc,char **argv)
   }
 
   XCloseDisplay(sm->grafix.display);
+  return 0;
 }
 
 /***************************/
@@ -383,7 +380,7 @@ static void start_signal(void)
  #ifdef RS6000 /* ibm rs/6000 */
    sigemptyset(&vec.sa_mask);
  #else
-   vec.sa_mask = 0;
+   (void)sigprocmask (SIG_SETMASK, 0, NULL);
  #endif
   vec.sa_flags = 0;
   if ( sigaction(SIGALRM, &vec, &ovec) == -1) perror("SIGALRM\n");
@@ -412,7 +409,7 @@ static void setup_sigchild(void)
  #ifdef RS6000 /* ibm rs/6000 */
    sigemptyset(&vec.sa_mask);
  #else
-  vec.sa_mask = 0;
+   (void)sigprocmask (SIG_SETMASK, 0, NULL);
  #endif
   vec.sa_flags = 0;
   if ( sigaction(SIGCHLD, &vec, NULL) == -1) perror("SIGCHLD\n");