[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.
This commit is contained in:
Michael Brown
2008-06-03 23:46:36 +01:00
parent c899bdc5a8
commit 75965c9c6e
3 changed files with 53 additions and 15 deletions

View File

@@ -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" },
{ 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" },
{ ECONNRESET, "Connection reset" },
{ EINVAL, "Invalid argument" },
{ EIO, "Input/output error" },
{ ENETUNREACH, "Network unreachable" },
{ 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" },
};