summaryrefslogtreecommitdiffstats
path: root/src/hci/strerror.c
diff options
context:
space:
mode:
authorMichael Brown2008-06-04 00:46:36 +0200
committerMichael Brown2008-06-04 00:47:20 +0200
commit75965c9c6e9eca6d790710351f054689f4578a85 (patch)
tree33131a0d6481b36fa1547014ea37d62da9e5010b /src/hci/strerror.c
parent[Makefile] Remove obsolete SRCDIRS (diff)
downloadipxe-75965c9c6e9eca6d790710351f054689f4578a85.tar.gz
ipxe-75965c9c6e9eca6d790710351f054689f4578a85.tar.xz
ipxe-75965c9c6e9eca6d790710351f054689f4578a85.zip
[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 69675905..74995e8b 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" },
};