summaryrefslogtreecommitdiffstats
path: root/support/kconfig/util.c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-04-04 11:24:24 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2013-04-11 09:30:39 +0200
commit6997e461fdb39985957d24d81e612113cf39e35c (patch)
tree096947e214caf457ffdb005522698f3e747ad08a /support/kconfig/util.c
parentcfe70c5e13fcf6d99394c646c758236a79041653 (diff)
downloadbuildroot-novena-6997e461fdb39985957d24d81e612113cf39e35c.tar.gz
buildroot-novena-6997e461fdb39985957d24d81e612113cf39e35c.zip
support/kconfig: upgrade to 3.9-rc2
Our kconfig code is updated to the version of kernel 3.9-rc2. No major issues during the migration, except: * Some conflicts when applying 03-change-config-option-prefix.patch due to upstream kernel changes. * The need of adding a new patch, 15-fix-qconf-moc-rule.patch, to fix the make rule that generates the moc file for the Qt-based interface. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'support/kconfig/util.c')
-rw-r--r--support/kconfig/util.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/support/kconfig/util.c b/support/kconfig/util.c
index 6edd8a3d1..60eb56618 100644
--- a/support/kconfig/util.c
+++ b/support/kconfig/util.c
@@ -5,6 +5,8 @@
* Released under the terms of the GNU GPL v2.0.
*/
+#include <stdarg.h>
+#include <stdlib.h>
#include <string.h>
#include "lkc.h"
@@ -21,7 +23,7 @@ struct file *file_lookup(const char *name)
}
}
- file = malloc(sizeof(*file));
+ file = xmalloc(sizeof(*file));
memset(file, 0, sizeof(*file));
file->name = file_name;
file->next = file_list;
@@ -91,7 +93,7 @@ int file_write_dep(const char *name)
struct gstr str_new(void)
{
struct gstr gs;
- gs.s = malloc(sizeof(char) * 64);
+ gs.s = xmalloc(sizeof(char) * 64);
gs.len = 64;
gs.max_width = 0;
strcpy(gs.s, "\0");
@@ -148,3 +150,22 @@ const char *str_get(struct gstr *gs)
return gs->s;
}
+void *xmalloc(size_t size)
+{
+ void *p = malloc(size);
+ if (p)
+ return p;
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+}
+
+void *xcalloc(size_t nmemb, size_t size)
+{
+ void *p = calloc(nmemb, size);
+ if (p)
+ return p;
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+}
+
+