commit: 8fa6f295a007016e2c52a2fb14daf90ffee98139
parent 452729a128923680a1406870c4e02fd62ef3d427
Author: Michael Forney <mforney@mforney.org>
Date: Thu, 20 Jun 2019 21:52:27 -0700
plan9port: Remove some duplicate definitions
Diffstat:
2 files changed, 277 insertions(+), 1 deletion(-)
diff --git a/pkg/plan9port/patch/0006-Remove-some-duplicate-definitions.patch b/pkg/plan9port/patch/0006-Remove-some-duplicate-definitions.patch
@@ -0,0 +1,276 @@
+From f004781388e26321104aa30badce135f6c48a89e Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Thu, 20 Jun 2019 21:50:14 -0700
+Subject: [PATCH] Remove some duplicate definitions
+
+---
+ src/cmd/rc/exec.c | 11 +++++++++--
+ src/cmd/rc/exec.h | 12 ++++++------
+ src/cmd/rc/io.c | 1 +
+ src/cmd/rc/io.h | 2 +-
+ src/cmd/rc/lex.c | 3 +++
+ src/cmd/rc/plan9ish.c | 7 +------
+ src/cmd/rc/rc.h | 24 ++++++++++--------------
+ src/cmd/rc/simple.c | 2 ++
+ src/cmd/rc/subr.c | 3 ++-
+ src/cmd/rc/var.c | 1 +
+ src/libplumb/mesg.c | 2 --
+ 11 files changed, 36 insertions(+), 32 deletions(-)
+
+diff --git a/src/cmd/rc/exec.c b/src/cmd/rc/exec.c
+index 1fb9be53..e678da05 100644
+--- a/src/cmd/rc/exec.c
++++ b/src/cmd/rc/exec.c
+@@ -3,11 +3,16 @@
+ #include "exec.h"
+ #include "io.h"
+ #include "fns.h"
++int mypid;
++thread *runq;
++code *codebuf;
++int ntrap;
++int trap[NSIG];
++int eflagok;
++
+ /*
+ * Start executing the given code at the given pc with the given redirection
+ */
+-char *argv0="rc";
+-
+ void
+ start(code *c, int pc, var *local)
+ {
+@@ -136,6 +141,8 @@ main(int argc, char *argv[])
+ char num[12], *rcmain;
+ int i;
+
++ argv0 = "rc";
++
+ /* needed for rcmain later */
+ putenv("PLAN9", unsharp("#9"));
+
+diff --git a/src/cmd/rc/exec.h b/src/cmd/rc/exec.h
+index 06d2991f..ab0bfb42 100644
+--- a/src/cmd/rc/exec.h
++++ b/src/cmd/rc/exec.h
+@@ -56,18 +56,18 @@ struct thread{
+ tree *treenodes; /* tree nodes created by this process */
+ thread *ret; /* who continues when this finishes */
+ };
+-thread *runq;
++extern thread *runq;
+ code *codecopy(code*);
+-code *codebuf; /* compiler output */
+-int ntrap; /* number of outstanding traps */
+-int trap[NSIG]; /* number of outstanding traps per type */
++extern code *codebuf; /* compiler output */
++extern int ntrap; /* number of outstanding traps */
++extern int trap[NSIG]; /* number of outstanding traps per type */
+ struct builtin{
+ char *name;
+ void (*fnc)(void);
+ };
+ extern struct builtin Builtin[];
+-int eflagok; /* kludge flag so that -e doesn't exit in startup */
+-int havefork;
++extern int eflagok; /* kludge flag so that -e doesn't exit in startup */
++extern int havefork;
+
+ void execcd(void), execwhatis(void), execeval(void), execexec(void);
+ int execforkexec(void);
+diff --git a/src/cmd/rc/io.c b/src/cmd/rc/io.c
+index ac3b7585..ca994707 100644
+--- a/src/cmd/rc/io.c
++++ b/src/cmd/rc/io.c
+@@ -4,6 +4,7 @@
+ #include "exec.h"
+ #include "io.h"
+ #include "fns.h"
++io *err;
+ int pfmtnest = 0;
+
+ void
+diff --git a/src/cmd/rc/io.h b/src/cmd/rc/io.h
+index 21cc6b8e..68b9e896 100644
+--- a/src/cmd/rc/io.h
++++ b/src/cmd/rc/io.h
+@@ -10,7 +10,7 @@ struct io{
+ int fd;
+ char *bufp, *ebuf, *strp, buf[NBUF];
+ };
+-io *err;
++extern io *err;
+ io *openfd(int), *openstr(void), *opencore(char *, int);
+ int emptybuf(io*);
+ void pchr(io*, int);
+diff --git a/src/cmd/rc/lex.c b/src/cmd/rc/lex.c
+index d9369e5c..14cb595a 100644
+--- a/src/cmd/rc/lex.c
++++ b/src/cmd/rc/lex.c
+@@ -22,6 +22,7 @@ idchr(int c)
+ return c>' ' && !strchr("!\"#$%&'()+,-./:;<=>?@[\\]^`{|}~", c);
+ }
+ int future = EOF;
++char *promptstr;
+ int doprompt = 1;
+ int inquote;
+ int incomm;
+@@ -36,6 +37,7 @@ nextc(void)
+ future = getnext();
+ return future;
+ }
++int lastc;
+ /*
+ * Consume the lookahead character.
+ */
+@@ -148,6 +150,7 @@ nextis(int c)
+ }
+ return 0;
+ }
++char tok[NTOK];
+
+ char*
+ addtok(char *p, int val)
+diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c
+index 60c0ee45..c395856f 100644
+--- a/src/cmd/rc/plan9ish.c
++++ b/src/cmd/rc/plan9ish.c
+@@ -449,13 +449,8 @@ notifyf(void *unused0, char *s)
+ int i;
+ for(i=0;syssigname[i];i++)
+ if(strncmp(s, syssigname[i], strlen(syssigname[i]))==0){
+- if(strncmp(s, "sys: ", 5)!=0){
+- if(kidpid && !interrupted){
+- interrupted=1;
+- postnote(PNGROUP, kidpid, s);
+- }
++ if(strncmp(s, "sys: ", 5)!=0)
+ interrupted = 1;
+- }
+ goto Out;
+ }
+ if(strcmp(s, "sys: window size change") != 0)
+diff --git a/src/cmd/rc/rc.h b/src/cmd/rc/rc.h
+index 986b8bef..24ef2f70 100644
+--- a/src/cmd/rc/rc.h
++++ b/src/cmd/rc/rc.h
+@@ -59,7 +59,6 @@ tree *mung1(tree*, tree*), *mung2(tree*, tree*, tree*);
+ tree *mung3(tree*, tree*, tree*, tree*), *epimung(tree*, tree*);
+ tree *simplemung(tree*), *heredoc(tree*);
+ void freetree(tree*);
+-tree *cmdtree;
+ /*
+ * The first word of any code vector is a reference count.
+ * Always create a new reference to a code vector by calling codecopy(.).
+@@ -70,10 +69,10 @@ union code{
+ int i;
+ char *s;
+ };
+-char *promptstr;
+-int doprompt;
++extern char *promptstr;
++extern int doprompt;
+ #define NTOK 8192
+-char tok[NTOK];
++extern char tok[NTOK];
+ #define APPEND 1
+ #define WRITE 2
+ #define READ 3
+@@ -93,7 +92,7 @@ struct var{
+ };
+ var *vlook(char*), *gvlook(char*), *newvar(char*, var*);
+ #define NVAR 521
+-var *gvar[NVAR]; /* hash for globals */
++extern var *gvar[NVAR]; /* hash for globals */
+ #define new(type) ((type *)emalloc(sizeof(type)))
+ char *emalloc(long);
+ void *Malloc(ulong);
+@@ -104,7 +103,7 @@ struct here{
+ char *name;
+ struct here *next;
+ };
+-int mypid;
++extern int mypid;
+ /*
+ * Glob character escape in strings:
+ * In a string, GLOB must be followed by *?[ or GLOB.
+@@ -123,10 +122,8 @@ int mypid;
+ #define threebyte(c) ((c&0xf0)==0xe0)
+ #define fourbyte(c) ((c&0xf8)==0xf0)
+
+-char **argp;
+-char **args;
+-int nerror; /* number of errors encountered during compilation */
+-int doprompt; /* is it time for a prompt? */
++extern int nerror; /* number of errors encountered during compilation */
++extern int doprompt; /* is it time for a prompt? */
+ /*
+ * Which fds are the reading/writing end of a pipe?
+ * Unfortunately, this can vary from system to system.
+@@ -141,8 +138,7 @@ extern char Rcmain[], Fdprefix[];
+ * How many dot commands have we executed?
+ * Used to ensure that -v flag doesn't print rcmain.
+ */
+-int ndot;
++extern int ndot;
+ char *getstatus(void);
+-int lastc;
+-int lastword;
+-int kidpid;
++extern int lastc;
++extern int lastword;
+diff --git a/src/cmd/rc/simple.c b/src/cmd/rc/simple.c
+index d587227a..7f1ee12e 100644
+--- a/src/cmd/rc/simple.c
++++ b/src/cmd/rc/simple.c
+@@ -6,6 +6,8 @@
+ #include "exec.h"
+ #include "io.h"
+ #include "fns.h"
++int ndot;
++
+ /*
+ * Search through the following code to see if we're just going to exit.
+ */
+diff --git a/src/cmd/rc/subr.c b/src/cmd/rc/subr.c
+index 47f7439e..f919718c 100644
+--- a/src/cmd/rc/subr.c
++++ b/src/cmd/rc/subr.c
+@@ -22,7 +22,8 @@ efree(char *p)
+ free(p);
+ else pfmt(err, "free 0\n");
+ }
+-extern int lastword, lastdol;
++extern int lastdol;
++int nerror;
+
+ void
+ yyerror(char *m)
+diff --git a/src/cmd/rc/var.c b/src/cmd/rc/var.c
+index 2564ba2f..b4a3ef5b 100644
+--- a/src/cmd/rc/var.c
++++ b/src/cmd/rc/var.c
+@@ -1,6 +1,7 @@
+ #include "rc.h"
+ #include "exec.h"
+ #include "fns.h"
++var *gvar[NVAR];
+
+ int
+ hash(char *s, int n)
+diff --git a/src/libplumb/mesg.c b/src/libplumb/mesg.c
+index c9379307..f33d7c67 100755
+--- a/src/libplumb/mesg.c
++++ b/src/libplumb/mesg.c
+@@ -5,8 +5,6 @@
+
+ static char attrbuf[4096];
+
+-char *home;
+-
+ static int
+ Strlen(char *s)
+ {
+--
+2.22.0
+
diff --git a/pkg/plan9port/ver b/pkg/plan9port/ver
@@ -1 +1 @@
-35d4392448 r0
+35d4392448 r1