summaryrefslogtreecommitdiff
path: root/package/config
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-07-08 00:00:17 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-07-08 00:00:17 +0000
commitf987b7a54199cad8eed8b4fccfbe33478adf243a (patch)
treec2e708e84a6d3765ad74c483de93d21d27aea89b /package/config
parent59238272627ecc10d40e2f714fa6bee0018edadf (diff)
- silence a cosmetic warning (closes several issues in mantis).
This also provides a nice up-to-date filestamp if something got reconfigured (e.g. c++ support got toggled) that can be used in the future to depend accordingly.
Diffstat (limited to 'package/config')
-rw-r--r--package/config/confdata.c25
-rw-r--r--package/config/kconfig-to-buildroot2.patch57
2 files changed, 77 insertions, 5 deletions
diff --git a/package/config/confdata.c b/package/config/confdata.c
index c19b6ffed..0098a08ee 100644
--- a/package/config/confdata.c
+++ b/package/config/confdata.c
@@ -11,6 +11,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <libgen.h>
#define LKC_DIRECT_LINK
#include "lkc.h"
@@ -529,7 +530,7 @@ int conf_write(const char *name)
int conf_split_config(void)
{
- char *name, path[128];
+ char *name, path[128], *opwd, *dir, *_name;
char *s, *d, c;
struct symbol *sym;
struct stat sb;
@@ -540,8 +541,20 @@ int conf_split_config(void)
name = "include/config/auto.conf";
conf_read_simple(name, S_DEF_AUTO);
- if (chdir("include/config"))
+ opwd = malloc(256);
+ _name = strdup(name);
+ if (opwd == NULL || _name == NULL)
return 1;
+ opwd = getcwd(opwd, 256);
+ dir = dirname(_name);
+ if (dir == NULL) {
+ res = 1;
+ goto err;
+ }
+ if (chdir(dir)) {
+ res = 1;
+ goto err;
+ }
res = 0;
for_all_symbols(i, sym) {
@@ -634,9 +647,11 @@ int conf_split_config(void)
close(fd);
}
out:
- if (chdir("../.."))
- return 1;
-
+ if (chdir(opwd))
+ res = 1;
+err:
+ free(opwd);
+ free(_name);
return res;
}
diff --git a/package/config/kconfig-to-buildroot2.patch b/package/config/kconfig-to-buildroot2.patch
index 94eae856b..361174a57 100644
--- a/package/config/kconfig-to-buildroot2.patch
+++ b/package/config/kconfig-to-buildroot2.patch
@@ -667,3 +667,60 @@ Index: confdata.c
if (conf_split_config())
return 1;
+diff -rdup x/config/confdata.c package/config/confdata.c
+--- x/config/confdata.c 2007-07-07 11:13:12.000000000 +0200
++++ package/config/confdata.c 2007-07-08 01:30:44.000000000 +0200
+@@ -11,6 +11,7 @@
+ #include <string.h>
+ #include <time.h>
+ #include <unistd.h>
++#include <libgen.h>
+
+ #define LKC_DIRECT_LINK
+ #include "lkc.h"
+@@ -529,7 +530,7 @@ int conf_write(const char *name)
+
+ int conf_split_config(void)
+ {
+- char *name, path[128];
++ char *name, path[128], *opwd, *dir, *_name;
+ char *s, *d, c;
+ struct symbol *sym;
+ struct stat sb;
+@@ -540,8 +541,20 @@ int conf_split_config(void)
+ name = "include/config/auto.conf";
+ conf_read_simple(name, S_DEF_AUTO);
+
+- if (chdir("include/config"))
++ opwd = malloc(256);
++ _name = strdup(name);
++ if (opwd == NULL || _name == NULL)
+ return 1;
++ opwd = getcwd(opwd, 256);
++ dir = dirname(_name);
++ if (dir == NULL) {
++ res = 1;
++ goto err;
++ }
++ if (chdir(dir)) {
++ res = 1;
++ goto err;
++ }
+
+ res = 0;
+ for_all_symbols(i, sym) {
+@@ -634,9 +647,11 @@ int conf_split_config(void)
+ close(fd);
+ }
+ out:
+- if (chdir("../.."))
+- return 1;
+-
++ if (chdir(opwd))
++ res = 1;
++err:
++ free(opwd);
++ free(_name);
+ return res;
+ }
+