@@ -743,26 +743,26 @@ int conf_write(const char *name)
char *env;
dirname[0] = 0;
- if (name && name[0]) {
- struct stat st;
- char *slash;
+ if (!name)
+ name = conf_get_configname();
+
+ struct stat st;
+ char *slash;
- if (!stat(name, &st) && S_ISDIR(st.st_mode)) {
- strcpy(dirname, name);
- strcat(dirname, "/");
+ if (!stat(name, &st) && S_ISDIR(st.st_mode)) {
+ strcpy(dirname, name);
+ strcat(dirname, "/");
+ basename = conf_get_configname();
+ } else if ((slash = strrchr(name, '/'))) {
+ int size = slash - name + 1;
+ memcpy(dirname, name, size);
+ dirname[size] = 0;
+ if (slash[1])
+ basename = slash + 1;
+ else
basename = conf_get_configname();
- } else if ((slash = strrchr(name, '/'))) {
- int size = slash - name + 1;
- memcpy(dirname, name, size);
- dirname[size] = 0;
- if (slash[1])
- basename = slash + 1;
- else
- basename = conf_get_configname();
- } else
- basename = name;
} else
- basename = conf_get_configname();
+ basename = name;
sprintf(newname, "%s%s", dirname, basename);
env = getenv("KCONFIG_OVERWRITECONFIG");
When no name arg is passed to conf_write, the .tmpconfig file used to prepare a new config is created in the working dir. If KCONFIG_CONFIG specifies a path which is not on the same volume, the rename fails with 'Invalid cross-device link'. This change determines the dir passed in KCONFIG_CONFIG, and uses it as the location for the tmpconfig. Signed-off-by: Andy Voltz <andy.voltz@timesys.com> --- scripts/kconfig/confdata.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)