static void hashcd(void);
/*
- * Actually do the chdir. We also call hashcd to let the routines in exec.c
+ * Actually do the chdir. We also call hashcd to let other routines
* know that the current directory has changed.
*/
static int
static void closescript(void);
/* Called after fork(), in child */
+/* jp and n are NULL when called by openhere() for heredoc support */
static NOINLINE void
forkchild(struct job *jp, union node *n, int mode)
{
{
TRACE(("In parent shell: child = %d\n", pid));
if (!jp) {
+ /* jp is NULL when called by openhere() for heredoc support */
while (jobless && dowait(DOWAIT_NONBLOCK, NULL) > 0)
continue;
jobless++;
}
}
+/* jp and n are NULL when called by openhere() for heredoc support */
static int
forkshell(struct job *jp, union node *n, int mode)
{
}
-/* ============ redir.c
- *
+/*
* Code for dealing with input/output redirection.
*/
ash_msg_and_raise_error("pipe call failed");
jp = makejob(/*n,*/ 1);
if (forkshell(jp, n, FORK_NOJOB) == 0) {
+ /* child */
FORCE_INT_ON;
close(pip[0]);
if (pip[1] != 1) {
evaltree(n, EV_EXIT); /* actually evaltreenr... */
/* NOTREACHED */
}
+ /* parent */
close(pip[1]);
result->fd = pip[0];
result->jp = jp;
evaltreenr(n->nredir.n, flags);
/* never returns */
}
+ /* parent */
status = 0;
if (!backgnd)
status = waitforjob(jp);
}
}
if (forkshell(jp, lp->n, n->npipe.pipe_backgnd) == 0) {
+ /* child */
INT_ON;
if (pip[1] >= 0) {
close(pip[0]);
evaltreenr(lp->n, flags);
/* never returns */
}
+ /* parent */
if (prevfd >= 0)
close(prevfd);
prevfd = pip[0];
}
-/* ============ input.c
- *
+/*
* This implements the input routines used by the parser.
*/
}
-/* ============ mail.c
- *
+/*
* Routines to check for mail.
*/