Close open files before calling builtin_exec(). I've tested this

and it fixes bug #1121.
 -Erik
This commit is contained in:
Eric Andersen 2001-03-06 20:28:22 +00:00
parent 1a046d5f9d
commit 07f2f3917a
3 changed files with 3 additions and 0 deletions

1
lash.c
View File

@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
if (child->argv[1] == NULL)
return EXIT_SUCCESS; /* Really? */
child->argv++;
close_all();
pseudo_exec(child);
/* never returns */
}

1
sh.c
View File

@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
if (child->argv[1] == NULL)
return EXIT_SUCCESS; /* Really? */
child->argv++;
close_all();
pseudo_exec(child);
/* never returns */
}

View File

@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
if (child->argv[1] == NULL)
return EXIT_SUCCESS; /* Really? */
child->argv++;
close_all();
pseudo_exec(child);
/* never returns */
}