infilename = (infile == NULL) ? "<stdin>" : infile; (void) pipe(pd); switch (fork()) { case 0: #ifdef __GNU_LIBRARY__  if (building_libc) unsetenv ("LD_LIBRARY_PATH"); #endif find_cpp(); putarg(0, CPP); putarg(1, CPPFLAGS); addarg(define); addarg(infile); addarg((char *)NULL); (void) close(1); (void) dup2(pd[1], 1); (void) close(pd[0]); execv(arglist[0], (char **)arglist); perror("execv"); exit(1); case -1: perror("fork"); exit(1); } (void) close(pd[1]); fin = fdopen(pd[0], "r"); if (fin == NULL) { f_print(stderr, "%s: ", cmdname); perror(infilename); crash(); }
infilename = (infile == NULL) ? "<stdin>" : infile; pipe (pd); switch (fork ()) { case 0: find_cpp (); putarg (0, CPP); putarg (1, CPPFLAGS); addarg (define); if (infile) addarg (infile); addarg ((char *) NULL); close (1); dup2 (pd[1], 1); close (pd[0]); execv (arglist[0], (char **) arglist); perror ("execv"); exit (1); case -1: perror ("fork"); exit (1); } close (pd[1]); fin = fdopen (pd[0], "r"); if (fin == NULL) { fprintf (stderr, "%s: ", cmdname); perror (infilename); crash (); }
open_input(const char *infile, const char *define){	int pd[2];	infilename = (infile == NULL) ? "<stdin>" : infile;	(void) pipe(pd);	switch (fork()) {	case 0:#ifdef __GNU_LIBRARY__		/* While building libc we don't want to use the libc from		   the build directory which may be incompatible with the		   installed dynamic linker.  */		if (building_libc)		  unsetenv ("LD_LIBRARY_PATH");#endif		find_cpp();		putarg(0, CPP);		putarg(1, CPPFLAGS);		addarg(define);		addarg(infile);		addarg((char *)NULL);		(void) close(1);		(void) dup2(pd[1], 1);		(void) close(pd[0]);		execv(arglist[0], (char **)arglist);		perror("execv");		exit(1);	case -1:		perror("fork");		exit(1);	}	(void) close(pd[1]);	fin = fdopen(pd[0], "r");	if (fin == NULL) {		f_print(stderr, "%s: ", cmdname);		perror(infilename);		crash();	}}