http://git.etherboot.org
/
gpxe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
be67084
)
[libc] Use only generic errortab entries to match generic errors
author
Michael Brown
<mcb30@etherboot.org>
Sat, 14 Nov 2009 21:08:39 +0000
(21:08 +0000)
committer
Michael Brown
<mcb30@etherboot.org>
Mon, 16 Nov 2009 22:08:59 +0000
(22:08 +0000)
src/hci/strerror.c
patch
|
blob
|
history
diff --git
a/src/hci/strerror.c
b/src/hci/strerror.c
index
216b1e5
..
94547dd
100644
(file)
--- a/
src/hci/strerror.c
+++ b/
src/hci/strerror.c
@@
-24,14
+24,13
@@
FILE_LICENCE ( GPL2_OR_LATER );
* Find error description
*
* @v errno Error number
* Find error description
*
* @v errno Error number
- * @v mask Mask of bits that we care about
* @ret errortab Error description, or NULL
*/
* @ret errortab Error description, or NULL
*/
-static struct errortab * find_error ( int errno
, int mask
) {
+static struct errortab * find_error ( int errno ) {
struct errortab *errortab;
for_each_table_entry ( errortab, ERRORTAB ) {
struct errortab *errortab;
for_each_table_entry ( errortab, ERRORTAB ) {
- if (
( ( errortab->errno ^ errno ) & mask ) == 0
)
+ if (
errortab->errno == errno
)
return errortab;
}
return errortab;
}
@@
-50,13
+49,13
@@
static struct errortab * find_closest_error ( int errno ) {
struct errortab *errortab;
/* First, look for an exact match */
struct errortab *errortab;
/* First, look for an exact match */
- if ( ( errortab = find_error ( errno
, 0x7fffffff
) ) != NULL )
+ if ( ( errortab = find_error ( errno ) ) != NULL )
return errortab;
/* Second, try masking off the gPXE-specific bit and seeing if
* we have an entry for the generic POSIX error message.
*/
return errortab;
/* Second, try masking off the gPXE-specific bit and seeing if
* we have an entry for the generic POSIX error message.
*/
- if ( ( errortab = find_error ( errno
, 0x4
f0000ff ) ) != NULL )
+ if ( ( errortab = find_error ( errno
& 0x7
f0000ff ) ) != NULL )
return errortab;
return NULL;
return errortab;
return NULL;