summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJuan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>2016-11-15 15:35:07 -0600
committerAnas Nashif <nashif@linux.intel.com>2016-11-18 23:22:21 +0000
commit7f1c76f2bfdffa549c2fe026743e0e1e6e635262 (patch)
tree7aff57a4c1673f7d459b5117f37a61734e1c6a30 /scripts
parent3e1d001f9b2ecce8c0a9d319610fb6cc051c75a1 (diff)
win-build: Fixes a kconfig incompatibility for Windows
In windows systems the rename() function fails if the new name of the original file corresponds to a file that already exists. The fix removes the new file before renaming the original one. Jira: ZEP-980 Change-Id: Ib3a43db86c0dd3fabb592f53ea7619eb5738bb65 Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/confdata.c5
-rw-r--r--scripts/kconfig/util.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index d21fe0938..02ee6e9e9 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -824,7 +824,9 @@ next:
if (*tmpname) {
strcat(dirname, basename);
strcat(dirname, ".old");
+ remove(dirname);
rename(newname, dirname);
+ remove(newname);
if (rename(tmpname, newname))
return 1;
}
@@ -1004,11 +1006,13 @@ int conf_write_autoconf(void)
name = getenv("KCONFIG_AUTOHEADER");
if (!name)
name = "include/generated/autoconf.h";
+ remove(name);
if (rename(".tmpconfig.h", name))
return 1;
name = getenv("KCONFIG_TRISTATE");
if (!name)
name = "include/config/tristate.conf";
+ remove(name);
if (rename(".tmpconfig_tristate", name))
return 1;
name = conf_get_autoconfig_name();
@@ -1016,6 +1020,7 @@ int conf_write_autoconf(void)
* This must be the last step, kbuild has a dependency on auto.conf
* and this marks the successful completion of the previous steps.
*/
+ remove(name);
if (rename(".tmpconfig", name))
return 1;
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 94f9c83e3..65f7052fb 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -72,6 +72,7 @@ int file_write_dep(const char *name)
fprintf(out, "\n$(deps_config): ;\n");
fclose(out);
+ remove(name);
rename("..config.tmp", name);
return 0;
}