Changeset 69b1f3d in mainline for uspace/lib/c/generic/str_error.c
- Timestamp:
- 2011-02-14T22:19:05Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f294926
- Parents:
- d4ee4e2 (diff), daec5e04 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str_error.c
rd4ee4e2 r69b1f3d 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 switch (e) { 73 case EBADCHECKSUM: 74 return "Bad checksum"; 75 case EAGAIN: 76 return "Resource temporarily unavailable"; 77 default: 78 break; 79 } 80 81 snprintf(noerr, NOERR_LEN, "Unkown error code %d", e); 71 82 return noerr; 72 83 }
Note:
See TracChangeset
for help on using the changeset viewer.