From 3d94569bbeed8f90ec36cea7d7f3f8f9077b1657 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 3 Dec 2018 13:33:04 +0000 Subject: ash: more clean up --- shell/ash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index 638f912c0..bf197cd70 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -357,7 +357,7 @@ struct forkshell { /* optional data, used by forkshell_child */ int flags; - int fd[10]; + int fd[3]; union node *n; char **argv; char *path; @@ -10750,7 +10750,7 @@ evalcommand(union node *cmd, int flags) spawn_forkshell(jp, &fs, FORK_FG); status = waitforjob(jp); INT_ON; - TRACE(("forked child exited with %d\n", exitstatus)); + TRACE(("forked child exited with %d\n", status)); break; } /* goes through to shellexec() */ @@ -15285,8 +15285,8 @@ tblentry_copy(struct tblentry *tep) memcpy(*newp, tep, size); switch (tep->cmdtype) { case CMDBUILTIN: - /* No pointer saving, this field must be fixed by forkshell_init() */ - (*newp)->param.cmd = (const struct builtincmd *)(tep->param.cmd - builtintab); + /* Save index of builtin, not pointer; fixed by forkshell_init() */ + (*newp)->param.index = tep->param.cmd - builtintab; break; case CMDFUNCTION: (*newp)->param.func = funcblock; @@ -15746,7 +15746,7 @@ forkshell_init(const char *idstr) struct tblentry *e = fs->cmdtable[i]; while (e) { if (e->cmdtype == CMDBUILTIN) - e->param.cmd = builtintab + (int)(intptr_t)e->param.cmd; + e->param.cmd = builtintab + e->param.index; e = e->next; } } -- cgit v1.2.3-55-g6feb