aboutsummaryrefslogtreecommitdiff
path: root/src/hci/strerror.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2008-06-03 23:46:36 +0100
committerMichael Brown <mcb30@etherboot.org>2008-06-03 23:47:20 +0100
commit75965c9c6e9eca6d790710351f054689f4578a85 (patch)
tree33131a0d6481b36fa1547014ea37d62da9e5010b /src/hci/strerror.c
parentc899bdc5a823e623b3e8f7598a7f77d65dcf2d2c (diff)
downloadipxe-75965c9c6e9eca6d790710351f054689f4578a85.zip
ipxe-75965c9c6e9eca6d790710351f054689f4578a85.tar.gz
ipxe-75965c9c6e9eca6d790710351f054689f4578a85.tar.bz2
[iSCSI] Produce meaningful errors on login failure
Return the most appropriate of EACCES, EPERM, ENODEV, ENOTSUP, EIO or EINVAL depending on the exact error returned by the target, rather than just always returning EPERM. Also, ensure that error strings exist for these errors.
Diffstat (limited to 'src/hci/strerror.c')
-rw-r--r--src/hci/strerror.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/hci/strerror.c b/src/hci/strerror.c
index 6967590..74995e8 100644
--- a/src/hci/strerror.c
+++ b/src/hci/strerror.c
@@ -108,15 +108,18 @@ const char * strerror ( int errno ) {
/** The most common errors */
struct errortab common_errors[] __errortab = {
{ 0, "No error" },
- { ENOMEM, "Out of memory" },
+ { EACCES, "Permission denied" },
+ { ECANCELED, "Operation cancelled" },
+ { ECONNRESET, "Connection reset" },
{ EINVAL, "Invalid argument" },
- { ENOSPC, "No space left on device" },
{ EIO, "Input/output error" },
- { EACCES, "Permission denied" },
- { ENOENT, "File not found" },
{ ENETUNREACH, "Network unreachable" },
- { ETIMEDOUT, "Connection timed out" },
- { EPIPE, "Broken pipe" },
- { ECANCELED, "Operation cancelled" },
+ { ENODEV, "No such device" },
+ { ENOENT, "File not found" },
{ ENOEXEC, "Not an executable image" },
+ { ENOMEM, "Out of memory" },
+ { ENOSPC, "No space left on device" },
+ { ENOTSUP, "Not supported" },
+ { EPERM, "Operation not permitted" },
+ { ETIMEDOUT, "Connection timed out" },
};