summaryrefslogtreecommitdiffstats
path: root/common/misc.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:44 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:44 +0200
commit3dcd63a9bdb3542bf8b6d7b0744f987384663f22 (patch)
tree3cc4da60a8a11ae39a61b6286fbcbfae46b0efcf /common/misc.c
parent07dbdaef611a0773049d50cd73535bbf315c3c13 (diff)
downloadbarebox-3dcd63a9bdb3542bf8b6d7b0744f987384663f22.tar.gz
svn_rev_332
make errno messages optional
Diffstat (limited to 'common/misc.c')
-rw-r--r--common/misc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/common/misc.c b/common/misc.c
index 5cab043..f7617d0 100644
--- a/common/misc.c
+++ b/common/misc.c
@@ -9,10 +9,10 @@ static ulong mem_malloc_start = 0;
static ulong mem_malloc_end = 0;
static ulong mem_malloc_brk = 0;
-void mem_malloc_init (ulong start, ulong end)
+void mem_malloc_init (void *start, void *end)
{
- mem_malloc_start = start;
- mem_malloc_end = end;
+ mem_malloc_start = (ulong)start;
+ mem_malloc_end = (ulong)end;
mem_malloc_brk = mem_malloc_start;
memset ((void *) mem_malloc_start, 0,
@@ -36,6 +36,7 @@ int errno;
void perror(char *s)
{
+#ifdef CONFIG_ERRNO_MESSAGES
char *str;
switch(-errno) {
case 0 : str = "No error"; break;
@@ -104,5 +105,8 @@ void perror(char *s)
};
printf("%s: %s\n", s, str);
+#else
+ printf("%s returned with %d\n", s, errno);
+#endif
}