code: plan9front

Download patch

ref: 8673b63eb344eac0734ff3ed335d28fb6154e3ca
parent: c4fdc433ee50b6dc7e50c16a8628093408743323
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Nov 4 17:02:50 EDT 2022

cc: wait for cpp to report whether it was a success

--- a/sys/src/cmd/cc/lex.c
+++ b/sys/src/cmd/cc/lex.c
@@ -180,7 +180,7 @@
 compile(char *file, char **defs, int ndef)
 {
 	char *ofile, *p, **av;
-	int i, c, fd[2];
+	int i, c, fd[2], status;
 	static int first = 1;
 
 	ofile = strdup(file);
@@ -300,6 +300,8 @@
 	yyparse();
 	if(!debug['a'] && !debug['Z'])
 		gclean();
+	if(mywait(&status) > 0 && status != 0)
+		nerrors++;
 	return nerrors;
 }