mirror of
				https://github.com/xcat2/xNBA.git
				synced 2025-10-31 03:12:32 +00:00 
			
		
		
		
	Added messages for some of the most common errors
This commit is contained in:
		| @@ -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" }, | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user