summaryrefslogtreecommitdiffstats
path: root/src/hci/strerror.c
diff options
context:
space:
mode:
authorMichael Brown2009-11-14 22:08:39 +0100
committerMichael Brown2009-11-16 23:08:59 +0100
commit76d5e493d198b35a6d9395d4edd33b9fa7220f8d (patch)
tree1a179bc0fce369195f99970bc3b05e38f42aa8ea /src/hci/strerror.c
parent[sanboot] Extend the "keep-san" option to non-iSCSI SAN protocols (diff)
downloadipxe-76d5e493d198b35a6d9395d4edd33b9fa7220f8d.tar.gz
ipxe-76d5e493d198b35a6d9395d4edd33b9fa7220f8d.tar.xz
ipxe-76d5e493d198b35a6d9395d4edd33b9fa7220f8d.zip
[libc] Use only generic errortab entries to match generic errors
Diffstat (limited to 'src/hci/strerror.c')
-rw-r--r--src/hci/strerror.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/hci/strerror.c b/src/hci/strerror.c
index 216b1e57..94547dd4 100644
--- 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
- * @v mask Mask of bits that we care about
* @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 ) {
- if ( ( ( errortab->errno ^ errno ) & mask ) == 0 )
+ if ( errortab->errno == errno )
return errortab;
}
@@ -50,13 +49,13 @@ static struct errortab * find_closest_error ( int errno ) {
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.
*/
- if ( ( errortab = find_error ( errno, 0x4f0000ff ) ) != NULL )
+ if ( ( errortab = find_error ( errno & 0x7f0000ff ) ) != NULL )
return errortab;
return NULL;