From 177c9f312829d5932a798a8e2c8f6feea1a8b8d5 Mon Sep 17 00:00:00 2001 From: "\"Robert P. J. Day\"" Date: Sat, 1 Jul 2006 14:30:28 +0000 Subject: Get rid of all "#if 0" content. --- shell/ash.c | 5 ----- shell/hush.c | 62 ------------------------------------------------------------ shell/lash.c | 10 ---------- shell/msh.c | 44 ------------------------------------------ 4 files changed, 121 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index 300f19132..cc46881c9 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -2547,11 +2547,6 @@ onint(void) { int i; intpending = 0; -#if 0 - /* comment by vodz: its strange for me, this programm don`t use other - signal block */ - sigsetmask(0); -#endif i = EXSIG; if (gotsig[SIGINT - 1] && !trap[SIGINT]) { if (!(rootshell && iflag)) { diff --git a/shell/hush.c b/shell/hush.c index 13a992fc2..6b6c54f3b 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -1251,15 +1251,6 @@ static int checkjobs(struct pipe* fg_pipe) /* child stopped */ pi->stopped_progs++; pi->progs[prognum].is_stopped = 1; - -#if 0 - /* Printing this stuff is a pain, since it tends to - * overwrite the prompt an inconveinient moments. So - * don't do that. */ - if (pi->stopped_progs == pi->num_progs) { - printf("\n"JOB_STATUS_FORMAT, pi->jobid, "Stopped", pi->text); - } -#endif } } @@ -1272,32 +1263,6 @@ static int checkjobs(struct pipe* fg_pipe) return -1; } -/* Figure out our controlling tty, checking in order stderr, - * stdin, and stdout. If check_pgrp is set, also check that - * we belong to the foreground process group associated with - * that tty. The value of shell_terminal is needed in order to call - * tcsetpgrp(shell_terminal, ...); */ -#if 0 -static void controlling_tty(int check_pgrp) -{ - pid_t curpgrp; - - if ((curpgrp = tcgetpgrp(shell_terminal = 2)) < 0 - && (curpgrp = tcgetpgrp(shell_terminal = 0)) < 0 - && (curpgrp = tcgetpgrp(shell_terminal = 1)) < 0) - goto shell_terminal_error; - - if (check_pgrp && curpgrp != getpgid(0)) - goto shell_terminal_error; - - return; - -shell_terminal_error: - shell_terminal = -1; - return; -} -#endif - /* run_pipe_real() starts all the jobs, but doesn't wait for anything * to finish. See checkjobs(). * @@ -1759,19 +1724,6 @@ static int glob_needed(const char *s) return 0; } -#if 0 -static void globprint(glob_t *pglob) -{ - int i; - debug_printf("glob_t at %p:\n", pglob); - debug_printf(" gl_pathc=%d gl_pathv=%p gl_offs=%d gl_flags=%d\n", - pglob->gl_pathc, pglob->gl_pathv, pglob->gl_offs, pglob->gl_flags); - for (i=0; igl_pathc; i++) - debug_printf("pglob->gl_pathv[%d] = %p = %s\n", i, - pglob->gl_pathv[i], pglob->gl_pathv[i]); -} -#endif - static int xglob(o_string *dest, int flags, glob_t *pglob) { int gr; @@ -2255,13 +2207,7 @@ static FILE *generate_stream_from_list(struct pipe *head) dup2(channel[1],1); close(channel[1]); } -#if 0 -#define SURROGATE "surrogate response" - write(1,SURROGATE,sizeof(SURROGATE)); - _exit(run_list(head)); -#else _exit(run_list_real(head)); /* leaks memory */ -#endif } debug_printf("forked child %d\n",pid); close(channel[1]); @@ -2476,14 +2422,6 @@ int parse_stream(o_string *dest, struct p_context *ctx, debug_printf("leaving parse_stream (triggered)\n"); return 0; } -#if 0 - if (ch=='\n') { - /* Yahoo! Time to run with it! */ - done_pipe(ctx,PIPE_SEQ); - run_list(ctx->list_head); - initialize_context(ctx); - } -#endif if (m!=2) switch (ch) { case '#': if (dest->length == 0 && !dest->quote) { diff --git a/shell/lash.c b/shell/lash.c index d87c5a25b..1b34052a1 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -543,16 +543,6 @@ static void checkjobs(struct jobset *j_list) /* child stopped */ job->stopped_progs++; job->progs[prognum].is_stopped = 1; - -#if 0 - /* Printing this stuff is a pain, since it tends to - * overwrite the prompt an inconveinient moments. So - * don't do that. */ - if (job->stopped_progs == job->num_progs) { - printf(JOB_STATUS_FORMAT, job->jobid, "Stopped", - job->text); - } -#endif } } diff --git a/shell/msh.c b/shell/msh.c index f8562b725..633070112 100644 --- a/shell/msh.c +++ b/shell/msh.c @@ -195,11 +195,7 @@ static char *T_CMD_NAMES[] = { #define BIT(i) (1<<(i)) #define FEXEC BIT(0) /* execute without forking */ -#if 0 /* Original value */ -#define AREASIZE (65000) -#else #define AREASIZE (90000) -#endif /* * flags to control evaluation of words @@ -2566,18 +2562,6 @@ static int execute(struct op *t, int *pin, int *pout, int act) ? eval(wp2, t->type == TCOM ? DOALL : DOALL & ~DOKEY) : NULL; -/* Hard to know how many words there are, be careful of garbage pointer values */ -/* They are likely to cause "PCI bus fault" errors */ -#if 0 - DBGPRINTF(("EXECUTE: t->left=%p, t->right=%p, t->words[1] is %s\n", - t->left, t->right, - ((t->words[1] == NULL) ? "NULL" : t->words[1]))); - DBGPRINTF7(("EXECUTE: t->words[2] is %s, t->words[3] is %s\n", - ((t->words[2] == NULL) ? "NULL" : t->words[2]), - ((t->words[3] == NULL) ? "NULL" : t->words[3]))); -#endif - - switch (t->type) { case TDOT: DBGPRINTF3(("EXECUTE: TDOT\n")); @@ -2796,21 +2780,6 @@ forkexec(struct op *t, int *pin, int *pout, int act, char **wp) DBGPRINTF7(("FORKEXEC: t->words is %s\n", ((t->words == NULL) ? "NULL" : t->words[0]))); -/* Hard to know how many words there are, be careful of garbage pointer values */ -/* They are likely to cause "PCI bus fault" errors */ -#if 0 - DBGPRINTF7(("FORKEXEC: t->words is %s, t->words[1] is %s\n", - ((t->words == NULL) ? "NULL" : t->words[0]), - ((t->words == NULL) ? "NULL" : t->words[1]))); - DBGPRINTF7(("FORKEXEC: wp is %s, wp[1] is %s\n", - ((wp == NULL) ? "NULL" : wp[0]), - ((wp[1] == NULL) ? "NULL" : wp[1]))); - DBGPRINTF7(("FORKEXEC: wp2 is %s, wp[3] is %s\n", - ((wp[2] == NULL) ? "NULL" : wp[2]), - ((wp[3] == NULL) ? "NULL" : wp[3]))); -#endif - - owp = wp; resetsig = 0; rv = -1; /* system-detected error */ @@ -2825,14 +2794,6 @@ forkexec(struct op *t, int *pin, int *pout, int act, char **wp) cp, wp, owp)); echo(cp ? wp : owp); } -#if 0 - DBGPRINTF9(("FORKEXEC: t->words is %s, t->words[1] is %s\n", - ((t->words == NULL) ? "NULL" : t->words[0]), - ((t->words == NULL) ? "NULL" : t->words[1]))); - DBGPRINTF9(("FORKEXEC: wp is %s, wp[1] is %s\n", - ((wp == NULL) ? "NULL" : wp[0]), - ((wp == NULL) ? "NULL" : wp[1]))); -#endif if (cp == NULL && t->ioact == NULL) { while ((cp = *owp++) != NULL && assign(cp, COPYV)); @@ -2846,11 +2807,6 @@ forkexec(struct op *t, int *pin, int *pout, int act, char **wp) t->words = wp; f = act; -#if 0 - DBGPRINTF3(("FORKEXEC: t->words is %s, t->words[1] is %s\n", - ((t->words == NULL) ? "NULL" : t->words[0]), - ((t->words == NULL) ? "NULL" : t->words[1]))); -#endif DBGPRINTF(("FORKEXEC: shcom %p, f&FEXEC 0x%x, owp %p\n", shcom, f & FEXEC, owp)); -- cgit v1.2.3