diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/misc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/common/misc.c b/common/misc.c index 43c1a0c62b..6754696598 100644 --- a/common/misc.c +++ b/common/misc.c @@ -75,13 +75,13 @@ int errno; EXPORT_SYMBOL(errno); -const char *errno_str(void) +const char *strerror(int errnum) { static char errno_string[10]; #ifdef CONFIG_ERRNO_MESSAGES char *str; - switch(-errno) { + switch(errnum) { case 0 : str = "No error"; break; case EPERM : str = "Operation not permitted"; break; case ENOENT : str = "No such file or directory"; break; @@ -145,16 +145,23 @@ const char *errno_str(void) case EREMOTEIO : str = "Remote I/O error"; break; #endif default: - sprintf(errno_string, "error %d", errno); + sprintf(errno_string, "error %d", errnum); return errno_string; }; return str; #else - sprintf(errno_string, "error %d", errno); + sprintf(errno_string, "error %d", errnum); + return errno_string; #endif } +EXPORT_SYMBOL(strerror); + +const char *errno_str(void) +{ + return strerror(-errno); +} EXPORT_SYMBOL(errno_str); void perror(const char *s) |