Browse Source

Print explicit error message on iSCSI boot failure, and add

"Permission denied" as an error text to strerror().
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
286db6ffa3
2 changed files with 4 additions and 1 deletions
  1. 1
    0
      src/hci/strerror.c
  2. 3
    1
      src/tests/iscsiboot.c

+ 1
- 0
src/hci/strerror.c View File

@@ -57,3 +57,4 @@ struct errortab enoem __errortab = { ENOMEM, "Out of memory" };
57 57
 struct errortab einval __errortab = { EINVAL, "Invalid argument" };
58 58
 struct errortab enospc __errortab = { ENOSPC, "No space left on device" };
59 59
 struct errortab eio __errortab = { EIO, "Input/output error" };
60
+struct errortab eacces __errortab = { EACCES, "Permission denied" };

+ 3
- 1
src/tests/iscsiboot.c View File

@@ -1,4 +1,5 @@
1 1
 #include <stdint.h>
2
+#include <string.h>
2 3
 #include <byteswap.h>
3 4
 #include <vsprintf.h>
4 5
 #include <gpxe/netdevice.h>
@@ -30,7 +31,8 @@ int test_iscsiboot ( const char *initiator_iqn,
30 31
 
31 32
 	printf ( "Initialising %s\n", target_iqn );
32 33
 	if ( ( rc = init_iscsidev ( &test_iscsidev ) ) != 0 ) {
33
-		printf ( "Could not reach %s\n", target_iqn );
34
+		printf ( "Could not reach %s: %s\n", target_iqn,
35
+			 strerror ( errno ) );
34 36
 		return rc;
35 37
 	}
36 38
 	ibft_fill_data ( netdev, initiator_iqn, target, target_iqn );

Loading…
Cancel
Save