aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/confdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/confdata.c')
-rw-r--r--scripts/kconfig/confdata.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 88429d723c9c..fad403dfa508 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -899,6 +899,9 @@ static int conf_write_dep(const char *name)
fprintf(out, "\n$(deps_config): ;\n");
fclose(out);
+
+ if (make_parent_dir(name))
+ return 1;
rename("..config.tmp", name);
return 0;
}
@@ -915,6 +918,8 @@ static int conf_split_config(void)
conf_read_simple(name, S_DEF_AUTO);
sym_calc_value(modules_sym);
+ if (make_parent_dir("include/config/foo.h"))
+ return 1;
if (chdir("include/config"))
return 1;
@@ -991,6 +996,7 @@ static int conf_split_config(void)
res = 1;
goto out;
}
+
/* Try it again. */
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd == -1) {
@@ -1063,14 +1069,22 @@ int conf_write_autoconf(void)
name = getenv("KCONFIG_AUTOHEADER");
if (!name)
name = "include/generated/autoconf.h";
+ if (make_parent_dir(name))
+ return 1;
if (rename(".tmpconfig.h", name))
return 1;
+
name = getenv("KCONFIG_TRISTATE");
if (!name)
name = "include/config/tristate.conf";
+ if (make_parent_dir(name))
+ return 1;
if (rename(".tmpconfig_tristate", name))
return 1;
+
name = conf_get_autoconfig_name();
+ if (make_parent_dir(name))
+ return 1;
/*
* This must be the last step, kbuild has a dependency on auto.conf
* and this marks the successful completion of the previous steps.