diff options
-rw-r--r-- | scripts/kconfig/confdata.c | 5 | ||||
-rw-r--r-- | scripts/kconfig/util.c | 1 |
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; } |