diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-05 18:01:39 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-07-05 18:01:39 +0200 |
commit | f0c67c6581e1e2f89fb6296797885af475dd878a (patch) | |
tree | 48ca78455d6a78128ba267faed10f7fb6857b10d /common/hush.c | |
parent | 488afcc90d921b3f4f954b044ae4bbd87d090beb (diff) | |
download | barebox-f0c67c6581e1e2f89fb6296797885af475dd878a.tar.gz barebox-f0c67c6581e1e2f89fb6296797885af475dd878a.tar.xz |
svn_rev_283
add xfuncs
Diffstat (limited to 'common/hush.c')
-rw-r--r-- | common/hush.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/common/hush.c b/common/hush.c index e27520fb85..9911655aae 100644 --- a/common/hush.c +++ b/common/hush.c @@ -90,6 +90,7 @@ #define __U_BOOT__ #ifdef __U_BOOT__ #include <malloc.h> /* malloc, free, realloc*/ +#include <xfuncs.h> #include <linux/ctype.h> /* isalpha, isdigit */ #include <common.h> /* readline */ #include <hush.h> @@ -382,10 +383,7 @@ static void __syntax(char *file, int line) { #define syntax() __syntax(__FILE__, __LINE__) #endif -#ifdef __U_BOOT__ -static void *xmalloc(size_t size); -static void *xrealloc(void *ptr, size_t size); -#else +#ifndef __U_BOOT__ /* Index of subroutines: */ /* function prototypes for builtins */ static int builtin_cd(struct child_prog *child); @@ -3259,27 +3257,6 @@ int u_boot_hush_start(void) return 0; } -static void *xmalloc(size_t size) -{ - void *p = NULL; - - if (!(p = malloc(size))) { - printf("ERROR : memory not allocated\n"); - for(;;); - } - return p; -} - -static void *xrealloc(void *ptr, size_t size) -{ - void *p = NULL; - - if (!(p = realloc(ptr, size))) { - printf("ERROR : memory not allocated\n"); - for(;;); - } - return p; -} #endif /* __U_BOOT__ */ #ifndef __U_BOOT__ |