changeset 456:415e7007008c

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;
author Rob Landley <rob@landley.net>
date Sat, 18 Aug 2007 00:08:46 -0500
parents 3e7c64539eb2
children b28f6437f95d
files tcc.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 */