Changes in uspace/lib/c/generic/str_error.c [80badbe:79ae36dd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str_error.c
r80badbe r79ae36dd 33 33 */ 34 34 35 #include <errno.h> 35 36 #include <str_error.h> 36 37 #include <stdio.h> … … 63 64 static fibril_local char noerr[NOERR_LEN]; 64 65 65 const char *str_error(const int e rrno)66 const char *str_error(const int e) 66 67 { 67 if ((e rrno <= 0) && (errno>= MIN_ERRNO))68 return err_desc[-e rrno];68 if ((e <= 0) && (e >= MIN_ERRNO)) 69 return err_desc[-e]; 69 70 70 snprintf(noerr, NOERR_LEN, "Unkown error code %d", errno); 71 /* Ad hoc descriptions of error codes interesting for USB. */ 72 // FIXME: integrate these as first-class error values 73 switch (e) { 74 case EBADCHECKSUM: 75 return "Bad checksum"; 76 case ESTALL: 77 return "Operation stalled"; 78 case EAGAIN: 79 return "Resource temporarily unavailable"; 80 case EEMPTY: 81 return "Resource is empty"; 82 default: 83 break; 84 } 85 86 snprintf(noerr, NOERR_LEN, "Unkown error code %d", e); 71 87 return noerr; 72 88 }
Note:
See TracChangeset
for help on using the changeset viewer.