[m-rev.] diff: fix exit status problem

Peter Ross peter.ross at miscrit.be
Fri Mar 23 22:03:49 AEDT 2001


Hi,


===================================================================


Estimated hours taken: 0.5
Branches: main, reuse, release

compiler/mercury_compile.m:
    Make sure that the exit status is set to a non-zero value if the
    number of errors is > 0.


Index: mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.175.2.16
diff -u -r1.175.2.16 mercury_compile.m
--- mercury_compile.m	2001/03/22 13:26:25	1.175.2.16
+++ mercury_compile.m	2001/03/23 11:00:17
@@ -554,7 +554,15 @@
 				MaybeRLFile, ModuleName, _CompileErrors)
 		    )
 		;
-		    []
+		    	% If the number of errors is > 0, make sure that
+			% the compiler exits with a non-zero exit
+			% status.
+		    io__get_exit_status(ExitStatus),
+		    ( { ExitStatus = 0 } ->
+		    	io__set_exit_status(1)
+		    ;
+		    	[]
+		    )
 		)
 	    )
 	;
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list