summaryrefslogtreecommitdiff
path: root/sysutils/socket/patches/patch-ai
blob: f3759fa4d193d44afaef76ce1f60ccab46680a73 (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
$NetBSD: patch-ai,v 1.4 2006/11/28 16:48:31 tv Exp $

--- utils.c.orig	1992-09-09 10:31:16.000000000 -0400
+++ utils.c
@@ -18,6 +18,7 @@ Please read the file COPYRIGHT for furth
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/time.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #ifdef ISC
@@ -25,8 +26,10 @@ Please read the file COPYRIGHT for furth
 #else
 #include <sys/resource.h>
 #endif
+#include <unistd.h>
 #include "globals.h"
 
+extern void initialize_siglist A((void)) ;
 
 /* Signal handler, print message and exit */
 SIG_HANDLER_RET exitsig(sig)
@@ -70,10 +73,10 @@ char *s ;
 
 /* set up signal handling. All except TSTP, CONT, CLD, and QUIT
  * are caught with exitsig(). */
-init_signals()
+void init_signals()
 {
     int i ;
-#ifdef SIG_SETMASK		/* only with BSD signals */
+#if defined(SIG_SETMASK) && !defined(__NetBSD__)		/* only with BSD signals */
     static struct sigvec svec = { exitsig, ~0, 0 } ;
 #endif
 
@@ -103,7 +106,7 @@ init_signals()
 	  case SIGQUIT:		/* if the user wants a core dump, */
 	    continue ;		/* they can have it. */
 	  default:	    
-#ifdef SIG_SETMASK
+#if defined(SIG_SETMASK) && !defined(__NetBSD__)
 	    sigvec(i, &svec, NULL) ;
 #else
 	    signal(i, exitsig) ;
@@ -173,12 +176,12 @@ char *prog ;
 void wait_for_children()
 {
     int wret, status ;
-#ifndef ISC
+#if !defined(ISC) && !defined(__INTERIX)
     struct rusage rusage ;
 #endif
 
     /* Just do a wait, forget result */
-#ifndef ISC
+#if !defined(ISC) && !defined(__INTERIX)
     while ((wret = wait3(&status, WNOHANG, &rusage)) > 0) ;
 #else
     while ((wret = waitpid(-1, &status, WNOHANG)) > 0) ;