]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Commit correct version of previous patch.
authorAndrew Stubbs <ams@gcc.gnu.org>
Tue, 18 Oct 2011 20:40:21 +0000 (20:40 +0000)
committerAndrew Stubbs <ams@gcc.gnu.org>
Tue, 18 Oct 2011 20:40:21 +0000 (20:40 +0000)
2011-10-18  Andrew Stubbs  <ams@codesourcery.com>

gcc/
* config/arm/driver-arm.c (host_detect_local_cpu): Close the file
before exiting.

From-SVN: r180168

gcc/config/arm/driver-arm.c

index c7ca4faa37f9fd4b34381954efb32407d5bdfa79..9a6762b4548e21675b1ddd12c6ed880ab0d20b80 100644 (file)
@@ -75,7 +75,7 @@ host_detect_local_cpu (int argc, const char **argv)
 {
   const char *val = NULL;
   char buf[128];
-  FILE *f;
+  FILE *f = NULL;
   bool arch;
   const struct vendor_cpu *cpu_table = NULL;
 
@@ -135,7 +135,8 @@ not_found:
     unsigned int opt;
     const char *search[] = {NULL, "arch"};
 
-    fclose (f);
+    if (f)
+      fclose (f);
 
     search[0] = argv[0];
     for (opt = 0; opt < ARRAY_SIZE (search); opt++)