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)) {
/* 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
}
}
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().
*
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; i<pglob->gl_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;
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]);
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) {
/* 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
}
}
#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
? 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"));
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 */
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));
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));