summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2015-10-26 21:57:43 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2015-10-26 21:57:43 +0000
commitb7484af053b0567d0c82712db3ddefcc04a19da0 (patch)
treeafd04acfc8ae18772705152b882d107e48c06b11 /bin
parent7272e7c1675dbf6285229ed90302d53eaaf1123c (diff)
remove the profiling and debugging ifdefs; ok zhuk@
Diffstat (limited to 'bin')
-rw-r--r--bin/csh/Makefile6
-rw-r--r--bin/csh/csh.c9
-rw-r--r--bin/csh/csh.h6
-rw-r--r--bin/csh/exp.c102
-rw-r--r--bin/csh/extern.h9
-rw-r--r--bin/csh/proc.c6
6 files changed, 7 insertions, 131 deletions
diff --git a/bin/csh/Makefile b/bin/csh/Makefile
index cc2a2c24a80..528b0d30188 100644
--- a/bin/csh/Makefile
+++ b/bin/csh/Makefile
@@ -1,13 +1,9 @@
-# $OpenBSD: Makefile,v 1.13 2015/10/26 15:01:15 naddy Exp $
+# $OpenBSD: Makefile,v 1.14 2015/10/26 21:57:42 naddy Exp $
#
# C Shell with process control; VM/UNIX VAX Makefile
# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
-#
-# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
PROG= csh
-#CFLAGS+=-g
-#CFLAGS+=-Wall
CFLAGS+=-I${.CURDIR} -I.
SRCS= alloc.c char.c const.c csh.c dir.c dol.c error.c exec.c exp.c file.c \
func.c glob.c hist.c init.c lex.c misc.c parse.c proc.c \
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index e6852ed4032..51d873ebf39 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: csh.c,v 1.32 2015/10/26 16:27:04 naddy Exp $ */
+/* $OpenBSD: csh.c,v 1.33 2015/10/26 21:57:42 naddy Exp $ */
/* $NetBSD: csh.c,v 1.14 1995/04/29 23:21:28 mycroft Exp $ */
/*-
@@ -819,9 +819,6 @@ void
exitstat(void)
{
Char *s;
-#ifdef PROF
- monitor(0);
-#endif
/*
* Note that if STATUS is corrupted (i.e. getn bombs) then error will exit
* directly because we poke child here. Otherwise we might continue
@@ -1257,11 +1254,7 @@ initdesc(void)
void
-#ifdef PROF
-done(int i)
-#else
xexit(int i)
-#endif
{
untty();
_exit(i);
diff --git a/bin/csh/csh.h b/bin/csh/csh.h
index 08ad8054ade..e80c9701078 100644
--- a/bin/csh/csh.h
+++ b/bin/csh/csh.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: csh.h,v 1.25 2015/10/26 16:31:09 naddy Exp $ */
+/* $OpenBSD: csh.h,v 1.26 2015/10/26 21:57:42 naddy Exp $ */
/* $NetBSD: csh.h,v 1.9 1995/03/21 09:02:40 cgd Exp $ */
/*-
@@ -53,10 +53,6 @@
#define FSHERR 18 /* ... shell diagnostics */
#define FOLDSTD 19 /* ... old std input */
-#ifdef PROF
-#define xexit(n) done(n)
-#endif
-
typedef short Char;
#define SAVE(a) (Strsave(str2short(a)))
diff --git a/bin/csh/exp.c b/bin/csh/exp.c
index e36f05d45b4..e271529ebfb 100644
--- a/bin/csh/exp.c
+++ b/bin/csh/exp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exp.c,v 1.13 2015/10/26 15:01:15 naddy Exp $ */
+/* $OpenBSD: exp.c,v 1.14 2015/10/26 21:57:42 naddy Exp $ */
/* $NetBSD: exp.c,v 1.6 1995/03/21 09:02:51 cgd Exp $ */
/*-
@@ -71,11 +71,6 @@ static void evalav(Char **);
static int isa(Char *, int);
static int egetn(Char *);
-#ifdef EDEBUG
-static void etracc(char *, Char *, Char ***);
-static void etraci(char *, int, Char ***);
-#endif
-
int
expr(Char ***vp)
{
@@ -87,17 +82,11 @@ exp0(Char ***vp, bool ignore)
{
int p1 = exp1(vp, ignore);
-#ifdef EDEBUG
- etraci("exp0 p1", p1, vp);
-#endif
if (**vp && eq(**vp, STRor2)) {
int p2;
(*vp)++;
p2 = exp0(vp, (ignore & IGNORE) || p1);
-#ifdef EDEBUG
- etraci("exp0 p2", p2, vp);
-#endif
return (p1 || p2);
}
return (p1);
@@ -108,17 +97,11 @@ exp1(Char ***vp, bool ignore)
{
int p1 = exp2_(vp, ignore);
-#ifdef EDEBUG
- etraci("exp1 p1", p1, vp);
-#endif
if (**vp && eq(**vp, STRand2)) {
int p2;
(*vp)++;
p2 = exp1(vp, (ignore & IGNORE) || !p1);
-#ifdef EDEBUG
- etraci("exp1 p2", p2, vp);
-#endif
return (p1 && p2);
}
return (p1);
@@ -129,17 +112,11 @@ exp2_(Char ***vp, bool ignore)
{
int p1 = exp2a(vp, ignore);
-#ifdef EDEBUG
- etraci("exp3 p1", p1, vp);
-#endif
if (**vp && eq(**vp, STRor)) {
int p2;
(*vp)++;
p2 = exp2_(vp, ignore);
-#ifdef EDEBUG
- etraci("exp3 p2", p2, vp);
-#endif
return (p1 | p2);
}
return (p1);
@@ -150,17 +127,11 @@ exp2a(Char ***vp, bool ignore)
{
int p1 = exp2b(vp, ignore);
-#ifdef EDEBUG
- etraci("exp2a p1", p1, vp);
-#endif
if (**vp && eq(**vp, STRcaret)) {
int p2;
(*vp)++;
p2 = exp2a(vp, ignore);
-#ifdef EDEBUG
- etraci("exp2a p2", p2, vp);
-#endif
return (p1 ^ p2);
}
return (p1);
@@ -171,17 +142,11 @@ exp2b(Char ***vp, bool ignore)
{
int p1 = exp2c(vp, ignore);
-#ifdef EDEBUG
- etraci("exp2b p1", p1, vp);
-#endif
if (**vp && eq(**vp, STRand)) {
int p2;
(*vp)++;
p2 = exp2b(vp, ignore);
-#ifdef EDEBUG
- etraci("exp2b p2", p2, vp);
-#endif
return (p1 & p2);
}
return (p1);
@@ -194,17 +159,11 @@ exp2c(Char ***vp, bool ignore)
Char *p2;
int i;
-#ifdef EDEBUG
- etracc("exp2c p1", p1, vp);
-#endif
if ((i = isa(**vp, EQOP)) != 0) {
(*vp)++;
if (i == EQMATCH || i == NOTEQMATCH)
ignore |= NOGLOB;
p2 = exp3(vp, ignore);
-#ifdef EDEBUG
- etracc("exp2c p2", p2, vp);
-#endif
if (!(ignore & IGNORE))
switch (i) {
@@ -240,17 +199,11 @@ exp3(Char ***vp, bool ignore)
int i;
p1 = exp3a(vp, ignore);
-#ifdef EDEBUG
- etracc("exp3 p1", p1, vp);
-#endif
if ((i = isa(**vp, RELOP)) != 0) {
(*vp)++;
if (**vp && eq(**vp, STRequal))
i |= 1, (*vp)++;
p2 = exp3(vp, ignore);
-#ifdef EDEBUG
- etracc("exp3 p2", p2, vp);
-#endif
if (!(ignore & IGNORE))
switch (i) {
@@ -284,16 +237,10 @@ exp3a(Char ***vp, bool ignore)
int i;
p1 = exp4(vp, ignore);
-#ifdef EDEBUG
- etracc("exp3a p1", p1, vp);
-#endif
op = **vp;
if (op && any("<>", op[0]) && op[0] == op[1]) {
(*vp)++;
p2 = exp3a(vp, ignore);
-#ifdef EDEBUG
- etracc("exp3a p2", p2, vp);
-#endif
if (op[0] == '<')
i = egetn(p1) << egetn(p2);
else
@@ -312,16 +259,10 @@ exp4(Char ***vp, bool ignore)
int i = 0;
p1 = exp5(vp, ignore);
-#ifdef EDEBUG
- etracc("exp4 p1", p1, vp);
-#endif
if (isa(**vp, ADDOP)) {
Char *op = *(*vp)++;
p2 = exp4(vp, ignore);
-#ifdef EDEBUG
- etracc("exp4 p2", p2, vp);
-#endif
if (!(ignore & IGNORE))
switch (op[0]) {
@@ -347,16 +288,10 @@ exp5(Char ***vp, bool ignore)
int i = 0, l;
p1 = exp6(vp, ignore);
-#ifdef EDEBUG
- etracc("exp5 p1", p1, vp);
-#endif
if (isa(**vp, MULOP)) {
Char *op = *(*vp)++;
p2 = exp5(vp, ignore);
-#ifdef EDEBUG
- etracc("exp5 p2", p2, vp);
-#endif
if (!(ignore & IGNORE))
switch (op[0]) {
@@ -404,9 +339,6 @@ exp6(Char ***vp, bool ignore)
if (eq(**vp, STRbang)) {
(*vp)++;
cp = exp6(vp, ignore);
-#ifdef EDEBUG
- etracc("exp6 ! cp", cp, vp);
-#endif
i = egetn(cp);
xfree(cp);
return (putn(!i));
@@ -414,9 +346,6 @@ exp6(Char ***vp, bool ignore)
if (eq(**vp, STRtilde)) {
(*vp)++;
cp = exp6(vp, ignore);
-#ifdef EDEBUG
- etracc("exp6 ~ cp", cp, vp);
-#endif
i = egetn(cp);
xfree(cp);
return (putn(~i));
@@ -424,9 +353,6 @@ exp6(Char ***vp, bool ignore)
if (eq(**vp, STRLparen)) {
(*vp)++;
ccode = exp0(vp, ignore);
-#ifdef EDEBUG
- etraci("exp6 () ccode", ccode, vp);
-#endif
if (*vp == 0 || **vp == 0 || ***vp != ')')
stderror(ERR_NAME | ERR_EXPRESSION);
(*vp)++;
@@ -461,9 +387,6 @@ exp6(Char ***vp, bool ignore)
}
pwait();
prestjob();
-#ifdef EDEBUG
- etraci("exp6 {} status", egetn(value(STRstatus)), vp);
-#endif
return (putn(egetn(value(STRstatus)) == 0));
}
if (isa(**vp, ANYOP))
@@ -558,15 +481,9 @@ exp6(Char ***vp, bool ignore)
break;
}
}
-#ifdef EDEBUG
- etraci("exp6 -? i", i, vp);
-#endif
xfree(ep);
return (putn(i));
}
-#ifdef EDEBUG
- etracc("exp6 default", cp, vp);
-#endif
return (ignore & NOGLOB ? Strsave(cp) : globone(cp, G_ERROR));
}
@@ -655,20 +572,3 @@ egetn(Char *cp)
}
/* Phew! */
-
-#ifdef EDEBUG
-static void
-etraci(char *str, int i, Char ***vp)
-{
- (void) fprintf(csherr, "%s=%d\t", str, i);
- blkpr(csherr, *vp);
- (void) fprintf(csherr, "\n");
-}
-static void
-etracc(char *str, Char *cp, Char ***vp)
-{
- (void) fprintf(csherr, "%s=%s\t", str, vis_str(cp));
- blkpr(csherr, *vp);
- (void) fprintf(csherr, "\n");
-}
-#endif
diff --git a/bin/csh/extern.h b/bin/csh/extern.h
index 0c76ef724a6..a791039f5ff 100644
--- a/bin/csh/extern.h
+++ b/bin/csh/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.23 2015/10/26 16:31:09 naddy Exp $ */
+/* $OpenBSD: extern.h,v 1.24 2015/10/26 21:57:42 naddy Exp $ */
/* $NetBSD: extern.h,v 1.8 1996/10/31 23:50:54 christos Exp $ */
/*-
@@ -48,12 +48,7 @@ void process(bool);
void rechist(void);
void untty(void);
int vis_fputc(int, FILE *);
-
-#ifdef PROF
-void done(int);
-#else
-void xexit(int);
-#endif
+void xexit(int);
/*
* dir.c
diff --git a/bin/csh/proc.c b/bin/csh/proc.c
index db11aada2df..db3e2c095c9 100644
--- a/bin/csh/proc.c
+++ b/bin/csh/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.27 2015/04/18 18:28:36 deraadt Exp $ */
+/* $OpenBSD: proc.c,v 1.28 2015/10/26 21:57:42 naddy Exp $ */
/* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */
/*-
@@ -279,10 +279,6 @@ pjwait(struct process *pp)
while ((fp = (fp->p_friends)) != pp);
if ((jobflags & PRUNNING) == 0)
break;
-#ifdef JOBDEBUG
- (void) fprintf(csherr, "starting to sigsuspend for SIGCHLD on %d\n",
- fp->p_pid);
-#endif /* JOBDEBUG */
sigset = osigset;
sigdelset(&sigset, SIGCHLD);
sigsuspend(&sigset);