OSDN Git Service

Commit correct version of previous patch.
authorams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Oct 2011 20:40:21 +0000 (20:40 +0000)
committerams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180168 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/arm/driver-arm.c

index c7ca4fa..9a6762b 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++)