diff mbox

[ARM] -m{cpu,tune,arch}=native

Message ID 4E9E9FE2.4030603@codesourcery.com
State New
Headers show

Commit Message

Andrew Stubbs Oct. 19, 2011, 10:01 a.m. UTC
On 18/10/11 15:42, Andrew Stubbs wrote:
>> Which still jumps to not_found without closing f.
>
> Hmmm, I know I fixed that, I know I did!
>
> But I appear to have lost the change somewhere when I updated my checkout?
>
> I'll fix it now.

Fixed and committed as attached.

Apologies for the cock-up. :(

Andrew
diff mbox

Patch

2011-10-18  Andrew Stubbs  <ams@codesourcery.com>

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

---
 src/gcc-mainline/gcc/config/arm/driver-arm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/gcc-mainline/gcc/config/arm/driver-arm.c b/src/gcc-mainline/gcc/config/arm/driver-arm.c
index 43b6e58..9a6762b 100644
--- a/src/gcc-mainline/gcc/config/arm/driver-arm.c
+++ b/src/gcc-mainline/gcc/config/arm/driver-arm.c
@@ -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;
 
@@ -134,6 +134,10 @@  not_found:
     unsigned int i;
     unsigned int opt;
     const char *search[] = {NULL, "arch"};
+
+    if (f)
+      fclose (f);
+
     search[0] = argv[0];
     for (opt = 0; opt < ARRAY_SIZE (search); opt++)
       for (i = 0; i < ARRAY_SIZE (configure_default_options); i++)