summaryrefslogtreecommitdiffstats
path: root/src/hci/strerror.c
diff options
context:
space:
mode:
authorMichael Brown2007-07-24 18:11:31 +0200
committerMichael Brown2007-07-24 18:11:31 +0200
commit9aa61ad5a26e04493a38bf4f9b6bd1228fef7a79 (patch)
tree3b86aec2b1cc194dca76178c0415c131e8a92b1b /src/hci/strerror.c
parentDefine -DOBJECT when generating Makefile rules, for consistency. (diff)
downloadipxe-9aa61ad5a26e04493a38bf4f9b6bd1228fef7a79.tar.gz
ipxe-9aa61ad5a26e04493a38bf4f9b6bd1228fef7a79.tar.xz
ipxe-9aa61ad5a26e04493a38bf4f9b6bd1228fef7a79.zip
Add per-file error identifiers
Diffstat (limited to 'src/hci/strerror.c')
-rw-r--r--src/hci/strerror.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/hci/strerror.c b/src/hci/strerror.c
index 7609f03e..4fc15d01 100644
--- a/src/hci/strerror.c
+++ b/src/hci/strerror.c
@@ -60,15 +60,7 @@ static struct errortab * find_closest_error ( int errno ) {
/* 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, 0x0000ffff ) ) != NULL )
- return errortab;
-
- /* Lastly, try masking off the POSIX bits and seeing if we
- * have a match just based on the PXENV component. This
- * allows us to report errors from underlying PXE stacks.
- */
- if ( ( errortab = find_error ( ( errno & 0x000000ff ),
- 0xffff00ff ) ) != NULL )
+ if ( ( errortab = find_error ( errno, 0x4f0000ff ) ) != NULL )
return errortab;
return NULL;
@@ -109,6 +101,10 @@ const char * strerror ( int errno ) {
return errbuf;
}
+/* Do not include ERRFILE portion in the numbers in the error table */
+#undef ERRFILE
+#define ERRFILE 0
+
/** The most common errors */
struct errortab common_errors[] __errortab = {
{ 0, "No error" },
@@ -121,4 +117,5 @@ struct errortab common_errors[] __errortab = {
{ ENETUNREACH, "Network unreachable" },
{ ETIMEDOUT, "Connection timed out" },
{ EPIPE, "Broken pipe" },
+ { ECANCELED, "Operation cancelled" },
};