summaryrefslogtreecommitdiff
path: root/plan9/rc/patches/patch-aa
blob: 809ac1455f2c78d02b0b12ac3a396db4a451faf4 (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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
*** Makefile.orig	Mon Mar  7 03:32:46 1994
--- Makefile	Wed Aug 20 15:19:15 1997
***************
*** 16,23 ****
  #ADDON=addon.o
  
  # Use an ANSI compiler (or at least one that groks prototypes and void *):
! CC=gcc -g -O
! CFLAGS=
  LDFLAGS=
  
  # You may substitute "bison -y" for yacc. (You want to choose the one that
--- 16,23 ----
  #ADDON=addon.o
  
  # Use an ANSI compiler (or at least one that groks prototypes and void *):
! CC=gcc
! CFLAGS= -O2
  LDFLAGS=
  
  # You may substitute "bison -y" for yacc. (You want to choose the one that
***************
*** 28,33 ****
--- 28,46 ----
  	glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \
  	nalloc.o open.o print.o redir.o sigmsgs.o signal.o status.o tree.o \
  	utils.o var.o version.o wait.o walk.o which.o y.tab.o
+ 
+ all: rc history
+ 
+ install:
+ 	$(INSTALL) -c rc $(PREFIX)/bin
+ 	$(INSTALL) -c history/history $(PREFIX)/bin
+ 	for i in - -- -p --p; do rm -f $(PREFIX)/bin/$$i; ln $(PREFIX)/bin/history $(PREFIX)/bin/$$i; done
+ 	$(INSTALL) -c rc.1 $(PREFIX)/man/man1
+ 	$(INSTALL) -c history/history.1 $(PREFIX)/man/man1
+ 	strip $(PREFIX)/bin/rc
+ 	strip $(PREFIX)/bin/history
+ 	gzip -9nf $(PREFIX)/man/man1/rc.1
+ 	gzip -9nf $(PREFIX)/man/man1/history.1
  
  # If rc is compiled with READLINE defined, you must supply the correct
  # arguments to ld on this line. Typically this would be something like:
*** builtins.c.orig	Mon Mar  7 03:32:49 1994
--- builtins.c	Wed Aug 20 15:22:52 1997
***************
*** 466,477 ****
  
  #ifndef SYSVR4
  extern int getrlimit(int, struct rlimit *);
  extern int setrlimit(int, struct rlimit *);
  #endif
  
  static void printlimit(const Limit *limit, bool hard) {
  	struct rlimit rlim;
! 	long lim;
  	getrlimit(limit->flag, &rlim);
  	if (hard)
  		lim = rlim.rlim_max;
--- 466,483 ----
  
  #ifndef SYSVR4
  extern int getrlimit(int, struct rlimit *);
+ 
+ /* #ifndef __FreeBSD__ */
+ #include <sys/param.h>
+ #if !(defined(BSD) && BSD >= 199306)
  extern int setrlimit(int, struct rlimit *);
  #endif
  
+ #endif
+ 
  static void printlimit(const Limit *limit, bool hard) {
  	struct rlimit rlim;
! 	u_quad_t lim;
  	getrlimit(limit->flag, &rlim);
  	if (hard)
  		lim = rlim.rlim_max;
***************
*** 490,496 ****
  	}
  }
  
! static long parselimit(const Limit *limit, char *s) {
  	char *t;
  	int len = strlen(s);
  	long lim = 1;
--- 496,502 ----
  	}
  }
  
! static u_quad_t parselimit(const Limit *limit, char *s) {
  	char *t;
  	int len = strlen(s);
  	long lim = 1;
*** utils.c.orig	Wed Aug 20 15:26:52 1997
--- utils.c	Wed Aug 20 15:28:11 1997
***************
*** 5,10 ****
--- 5,12 ----
  #include "rc.h"
  #include "jbwrap.h"
  
+ #include <sys/param.h>
+ 
  /* print error with line number on noninteractive shells (i.e., scripts) */
  
  extern void pr_error(char *s) {
***************
*** 19,26 ****
--- 21,30 ----
  /* our perror */
  
  extern void uerror(char *s) {
+ #if !(defined(BSD) && BSD >= 199306)
  	extern int sys_nerr;
  	extern char *sys_errlist[];
+ #endif
  	if (errno > sys_nerr)
  		return;
  	if (s != NULL)