Catch and report fdopen failures.

This commit is contained in:
Guy Helmer 2000-05-23 13:46:04 +00:00
parent 5c7cba96bc
commit 64ae78cb9d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60826

View File

@ -309,6 +309,11 @@ child_process(e, u)
register int escaped = FALSE;
register int ch;
if (out == NULL) {
warn("fdopen failed in child2");
_exit(ERROR_EXIT);
}
Debug(DPROC, ("[%d] child2 sending data to grandchild\n", getpid()))
/* close the pipe we don't use, since we inherited it and
@ -369,6 +374,11 @@ child_process(e, u)
register FILE *in = fdopen(stdout_pipe[READ_PIPE], "r");
register int ch = getc(in);
if (in == NULL) {
warn("fdopen failed in child");
_exit(ERROR_EXIT);
}
if (ch != EOF) {
register FILE *mail;
register int bytes = 1;