summaryrefslogtreecommitdiff
path: root/sysutils/xmeter/patches/patch-aa
blob: 2f9c2ba939b447ebb0a596160403db432d774d83 (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
62
63
$NetBSD: patch-aa,v 1.2 2012/12/20 21:37:37 joerg Exp $

Use the right signal handler type.

--- xmeter.c.orig	1994-05-25 01:01:15.000000000 +0000
+++ xmeter.c
@@ -135,6 +135,8 @@ static char	*RCSid="$Header: /net/src/ra
 #define PORTMAP		/* Get right function declarations on Solaris 2	*/
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
+#undef FSHIFT		/* Use protocol's shift and scale values */
+#undef FSCALE
 #include <rpcsvc/rstat.h>
 /*
  * We need the definitions of CP_USER, CP_NICE and CP_SYS.  Some systems
@@ -228,7 +230,7 @@ typedef struct {
     char	*name;		/* Name of stat for menu widget		*/
 } STATDATA;
 
-#if defined(SVR4) || defined(sgi)
+#if defined(SVR4) || defined(sgi) || (defined(BSD) && BSD >= 199306)
 #define SIGTYPE	void
 #else
 #define SIGTYPE	int
@@ -249,6 +251,8 @@ void		popdownscale();
 void		quit();
 char		*mystrdup();
 
+void runprog(METER *h, int s);
+
 static STATDATA		sd[] = {
 #define S_COLL		0
   {fcoll, "coll"},
@@ -922,7 +926,7 @@ char	*data;
   sh = h->sh;
   if (h->oldstate == FATAL && sh->pid != -1) {	/* Ignore dead hosts	*/
       *(double *) data = 0.0;
-      return;
+      return -1;
   }
   if (h->oldjumpscroll) {		/* Restore old jumpscroll value	*/
       n = 0;
@@ -987,6 +991,7 @@ char	*data;
 	  sh->pid = waitforhost(h);
   }
   h->oldstate = s;
+  return 0;
 }
 
 /*
@@ -1019,11 +1024,7 @@ METER	*h;
 /*
  * runprog - Run user specified alert program.
  */
-runprog(h, s)
-
-METER	*h;
-int	s;
-
+void runprog(METER *h, int s)
 {
   char	oldstate[4];
   char	state[4];