From f77d12f8d8a822aae41b835c0cca050928c58221 Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Thu, 8 Aug 2019 21:24:58 +0000 Subject: cmd/rc: fix declarations of some externally linked variables Change-Id: If8fe1afecb9fe55f85e8e5af37521b83e787d718 --- src/cmd/rc/exec.h | 2 +- src/cmd/rc/rc.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/cmd/rc') diff --git a/src/cmd/rc/exec.h b/src/cmd/rc/exec.h index 06d2991f..06cfd64e 100644 --- a/src/cmd/rc/exec.h +++ b/src/cmd/rc/exec.h @@ -67,7 +67,7 @@ struct builtin{ }; extern struct builtin Builtin[]; int eflagok; /* kludge flag so that -e doesn't exit in startup */ -int havefork; +extern int havefork; void execcd(void), execwhatis(void), execeval(void), execexec(void); int execforkexec(void); diff --git a/src/cmd/rc/rc.h b/src/cmd/rc/rc.h index 7778ff4c..46ff9510 100644 --- a/src/cmd/rc/rc.h +++ b/src/cmd/rc/rc.h @@ -71,7 +71,6 @@ union code{ char *s; }; char *promptstr; -int doprompt; #define NTOK 8192 char tok[NTOK]; #define APPEND 1 @@ -126,7 +125,7 @@ int mypid; char **argp; char **args; int nerror; /* number of errors encountered during compilation */ -int doprompt; /* is it time for a prompt? */ +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. -- cgit v1.2.3 From fa325e9b42b0bdfb48857d1958d9fb7ceac55151 Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Fri, 10 Jan 2020 14:44:21 +0000 Subject: Trivial changes: whitespace and modes. Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross --- src/cmd/rc/exec.c | 4 ++-- src/cmd/rc/havefork.c | 4 ++-- src/cmd/rc/lex.c | 2 +- src/cmd/rc/plan9ish.c | 8 ++++---- src/cmd/rc/tree.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/cmd/rc') diff --git a/src/cmd/rc/exec.c b/src/cmd/rc/exec.c index 03c96d49..172acfa3 100644 --- a/src/cmd/rc/exec.c +++ b/src/cmd/rc/exec.c @@ -135,7 +135,7 @@ main(int argc, char *argv[]) code bootstrap[32]; char num[12], *rcmain; int i; - + /* needed for rcmain later */ putenv("PLAN9", unsharp("#9")); @@ -690,7 +690,7 @@ word* copynwords(word *a, word *tail, int n) { word *v, **end; - + v = 0; end = &v; while(n-- > 0){ diff --git a/src/cmd/rc/havefork.c b/src/cmd/rc/havefork.c index dc0ca2e8..63f83354 100644 --- a/src/cmd/rc/havefork.c +++ b/src/cmd/rc/havefork.c @@ -37,11 +37,11 @@ Xasync(void) * ssh foo & will reopen /dev/tty, try to read a password, * get a signal, and repeat, in a tight loop, forever. * Arguably this is a bug in ssh (it behaves the same - * way under bash as under rc) but I'm fixing it here + * way under bash as under rc) but I'm fixing it here * anyway. If we dissociate the process from the tty, * then it won't be able to open /dev/tty ever again. * The SIG_IGN on SIGTTOU makes writing the tty - * (via fd 1 or 2, for example) succeed even though + * (via fd 1 or 2, for example) succeed even though * our pgrp is not the terminal's controlling pgrp. */ if((tty = open("/dev/tty", OREAD)) >= 0){ diff --git a/src/cmd/rc/lex.c b/src/cmd/rc/lex.c index d9369e5c..973ddee8 100644 --- a/src/cmd/rc/lex.c +++ b/src/cmd/rc/lex.c @@ -50,7 +50,7 @@ advance(void) } /* * read a character from the input stream - */ + */ int getnext(void) diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c index da9d8679..d52def7d 100644 --- a/src/cmd/rc/plan9ish.c +++ b/src/cmd/rc/plan9ish.c @@ -343,7 +343,7 @@ char **mkenv(){ } *ep=0; qsort((char *)env, nvar, sizeof ep[0], cmpenv); - return env; + return env; } void Updenv(void){} void Execute(word *args, word *path) @@ -556,7 +556,7 @@ int exitcode(char *msg) { int n; - + n = atoi(msg); if(n == 0) n = 1; @@ -579,7 +579,7 @@ void delwaitpid(int pid) { int r, w; - + for(r=w=0; rchild[0]); freetree(p->child[1]); freetree(p->child[2]); -- cgit v1.2.3