summaryrefslogtreecommitdiffstats
path: root/common/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/misc.c')
-rw-r--r--common/misc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/common/misc.c b/common/misc.c
index 920ac49978..cf6584975f 100644
--- a/common/misc.c
+++ b/common/misc.c
@@ -74,12 +74,11 @@ void *sbrk (ptrdiff_t increment)
int errno;
EXPORT_SYMBOL(errno);
-#ifndef CONFIG_ERRNO_MESSAGES
-static char errno_string[5];
-#endif
const char *errno_str(void)
{
+ static char errno_string[10];
+
#ifdef CONFIG_ERRNO_MESSAGES
char *str;
switch(-errno) {
@@ -145,13 +144,13 @@ const char *errno_str(void)
case EISNAM : str = "Is a named type file"; break;
case EREMOTEIO : str = "Remote I/O error"; break;
#endif
- default : str = "unknown error"; break;
+ default:
+ sprintf(errno_string, "error %d", errno);
+ return errno_string;
};
return str;
#else
- sprintf(errno_string, "%d", errno);
- return errno_string;
#endif
}
EXPORT_SYMBOL(errno_str);