# HG changeset patch # User Rob Landley # Date 1187413726 18000 # Node ID 415e7007008cada8a60899460180bc6f87cebe0e # Parent 3e7c64539eb2d99ab5eb02268e2f755a92c01823 Fix tcc exit code when unable to create output file. Michael Somos writes: I am using the latest CVS version 0.9.24 and found that the exit status is not getting set on error occurring in the compile and link. The problem comes from the function "tcc_output_file" in "tccelf.c" which returns an int which is -1 if an error exists. When it's called in "tcc.c" the return value is ignored. That code could be improved to ? ? ? ? ret = tcc_output_file(s, outfile) ? 1 : 0; diff -r 3e7c64539eb2 -r 415e7007008c tcc.c --- a/tcc.c Fri Jun 15 18:13:50 2007 -0400 +++ b/tcc.c Sat Aug 18 00:08:46 2007 -0500 @@ -9845,8 +9845,7 @@ } else #endif { - tcc_output_file(s, outfile); - ret = 0; + ret = tcc_output_file(s, outfile) ? 1 : 0; } the_end: /* XXX: cannot do it with bound checking because of the malloc hooks */