Fix a coredump that would occur when fdopen was unable to

return a valid fd.

PR:		49096
Submitted by:	demon
MFC after:	3 days
This commit is contained in:
Mike Silbersack 2003-06-19 20:04:51 +00:00
parent d4c737a952
commit 9be756b54b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116590

View file

@ -369,13 +369,14 @@ child_process(e, u)
/*local*/{
register FILE *in = fdopen(stdout_pipe[READ_PIPE], "r");
register int ch = getc(in);
register int ch;
if (in == NULL) {
warn("fdopen failed in child");
_exit(ERROR_EXIT);
}
ch = getc(in);
if (ch != EOF) {
register FILE *mail;
register int bytes = 1;