9
0
Fork 0

Print error number

When we do not have the appropriate error string compiled in, print
at least the number

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2008-11-10 17:40:09 +01:00
parent 87d4b9ec09
commit 54ec87f0cb
1 changed files with 5 additions and 6 deletions

View File

@ -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);