2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-14 23:31:39 +00:00

Added messages for some of the most common errors

This commit is contained in:
Michael Brown 2006-12-20 03:54:20 +00:00
parent 7766e34ed1
commit fc7dcc201b

View File

@ -38,6 +38,10 @@ const char * strerror ( int errno ) {
static char *generic_message = "Error 0x0000";
struct errortab *errortab;
/* Allow for strerror(rc) as well as strerror(errno) */
if ( errno < 0 )
errno = -errno;
for ( errortab = errortab_start ; errortab < errortab_end ;
errortab++ ) {
if ( errortab->errno == errno )
@ -47,3 +51,10 @@ const char * strerror ( int errno ) {
sprintf ( generic_message + 8, "%hx", errno );
return generic_message;
}
/** The most common errors */
struct errortab common_errortab[] __errortab = {
{ ENOMEM, "Out of memory" },
{ EINVAL, "Invalid argument" },
{ ENOSPC, "No space left on device" },
};