aboutsummaryrefslogtreecommitdiff
path: root/shells/v7sh/files/patch-error.c
blob: 7b73594922c90151dee531bab423631b1b0d702d (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
diff -u -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ error.c.orig error.c
--- error.c.orig	Fri Jun  4 02:51:01 2004
+++ error.c	Sat Jun 19 18:42:22 2004
@@ -9,15 +9,17 @@
 
 #include	"defs.h"
 
+STRING		exitadr;
+INT		exitval;
 
 /* ========	error handling	======== */
 
-exitset()
+VOID	exitset()
 {
 	assnum(&exitadr,exitval);
 }
 
-sigchk()
+VOID	sigchk()
 {
 	/* Find out if it is time to go away.
 	 * `trapnote' is set to SIGSET when fault is seen and
@@ -25,26 +27,29 @@
 	 */
 	IF trapnote&SIGSET
 	THEN	exitsh(SIGFAIL);
+		/*NOTREACHED*/
 	FI
 }
 
-failed(s1,s2)
-	STRING	s1, s2;
+VOID	failed(s1,s2)
+	CSTRING	s1, s2;
 {
 	prp(); prs(s1); 
 	IF s2
 	THEN	prs(colon); prs(s2);
 	FI
 	newline(); exitsh(ERROR);
+	/*NOTREACHED*/
 }
 
-error(s)
-	STRING	s;
+VOID	error(s)
+	CSTRING	s;
 {
 	failed(s,NIL);
+	/*NOTREACHED*/
 }
 
-exitsh(xno)
+VOID	exitsh(xno)
 	INT	xno;
 {
 	/* Arrive here from `FATAL' errors
@@ -57,23 +62,29 @@
 	exitval=xno;
 	IF (flags & (forked|errflg|ttyflg)) != ttyflg
 	THEN	done();
+		/*NOTREACHED*/
 	ELSE	clearup();
+#if defined(SYSIII)
+		execbrk = breakcnt = 0;
+#endif
 		longjmp(errshell,1);
 	FI
 }
 
-done()
+VOID	done()
 {
 	REG STRING	t;
-	IF t=trapcom[0]
+
+	IF (t=trapcom[0])!=NIL			/* GCC */
 	THEN	trapcom[0]=0; /*should free but not long */
 		execexp(t,0);
 	FI
 	rmtemp(0);
 	exit(exitval);
+	/*NOTREACHED*/
 }
 
-rmtemp(base)
+VOID	rmtemp(base)
 	IOPTR		base;
 {
 	WHILE iotemp>base