Patchwork [committed] PR fortran/46140 -- exit with nonzero status

login
register
mail settings
Submitter Steve Kargl
Date Oct. 25, 2010, 4:14 p.m.
Message ID <20101025161427.GA1843@troutmask.apl.washington.edu>
Download mbox | patch
Permalink /patch/69165/
State New
Headers show

Comments

Steve Kargl - Oct. 25, 2010, 4:14 p.m.
After regression testing on 4.4, 4.5, and trunk, and
after approval from Tobias Burnus in the PR, I have
committed

2010-10-25  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/46140
	* fortran/scanner.c (include_line): Check return value of load_file.

to the 4.4 and 4.5 branches and to trunk.  The patch
is attached.

Patch

Index: gcc/fortran/scanner.c
===================================================================
--- gcc/fortran/scanner.c	(revision 165917)
+++ gcc/fortran/scanner.c	(working copy)
@@ -1867,7 +1867,9 @@  include_line (gfc_char_t *line)
 		   read by anything else.  */
 
   filename = gfc_widechar_to_char (begin, -1);
-  load_file (filename, NULL, false);
+  if (load_file (filename, NULL, false) == FAILURE)
+    exit (1);
+
   gfc_free (filename);
   return true;
 }