|  | @@ -127,7 +127,9 @@ int uriboot ( struct uri *filename, struct uri *root_path, int drive,
 | 
		
	
		
			
			| 127 | 127 |  
 | 
		
	
		
			
			| 128 | 128 |  	/* Hook SAN device, if applicable */
 | 
		
	
		
			
			| 129 | 129 |  	if ( root_path ) {
 | 
		
	
		
			
			| 130 |  | -		if ( ( rc = san_hook ( root_path, drive ) ) != 0 ) {
 | 
		
	
		
			
			|  | 130 | +		drive = san_hook ( root_path, drive );
 | 
		
	
		
			
			|  | 131 | +		if ( drive < 0 ) {
 | 
		
	
		
			
			|  | 132 | +			rc = drive;
 | 
		
	
		
			
			| 131 | 133 |  			printf ( "Could not open SAN device: %s\n",
 | 
		
	
		
			
			| 132 | 134 |  				 strerror ( rc ) );
 | 
		
	
		
			
			| 133 | 135 |  			goto err_san_hook;
 | 
		
	
	
		
			
			|  | @@ -136,7 +138,7 @@ int uriboot ( struct uri *filename, struct uri *root_path, int drive,
 | 
		
	
		
			
			| 136 | 138 |  	}
 | 
		
	
		
			
			| 137 | 139 |  
 | 
		
	
		
			
			| 138 | 140 |  	/* Describe SAN device, if applicable */
 | 
		
	
		
			
			| 139 |  | -	if ( ( drive >= 0 ) && ! ( flags & URIBOOT_NO_SAN_DESCRIBE ) ) {
 | 
		
	
		
			
			|  | 141 | +	if ( ! ( flags & URIBOOT_NO_SAN_DESCRIBE ) ) {
 | 
		
	
		
			
			| 140 | 142 |  		if ( ( rc = san_describe ( drive ) ) != 0 ) {
 | 
		
	
		
			
			| 141 | 143 |  			printf ( "Could not describe SAN device %#02x: %s\n",
 | 
		
	
		
			
			| 142 | 144 |  				 drive, strerror ( rc ) );
 | 
		
	
	
		
			
			|  | @@ -170,7 +172,7 @@ int uriboot ( struct uri *filename, struct uri *root_path, int drive,
 | 
		
	
		
			
			| 170 | 172 |  	}
 | 
		
	
		
			
			| 171 | 173 |  
 | 
		
	
		
			
			| 172 | 174 |  	/* Attempt SAN boot if applicable */
 | 
		
	
		
			
			| 173 |  | -	if ( ( drive >= 0 ) && ! ( flags & URIBOOT_NO_SAN_BOOT ) ) {
 | 
		
	
		
			
			|  | 175 | +	if ( ! ( flags & URIBOOT_NO_SAN_BOOT ) ) {
 | 
		
	
		
			
			| 174 | 176 |  		if ( fetch_intz_setting ( NULL, &skip_san_boot_setting) == 0 ) {
 | 
		
	
		
			
			| 175 | 177 |  			printf ( "Booting from SAN device %#02x\n", drive );
 | 
		
	
		
			
			| 176 | 178 |  			rc = san_boot ( drive );
 | 
		
	
	
		
			
			|  | @@ -188,7 +190,7 @@ int uriboot ( struct uri *filename, struct uri *root_path, int drive,
 | 
		
	
		
			
			| 188 | 190 |   err_download:
 | 
		
	
		
			
			| 189 | 191 |   err_san_describe:
 | 
		
	
		
			
			| 190 | 192 |  	/* Unhook SAN device, if applicable */
 | 
		
	
		
			
			| 191 |  | -	if ( ( drive >= 0 ) && ! ( flags & URIBOOT_NO_SAN_UNHOOK ) ) {
 | 
		
	
		
			
			|  | 193 | +	if ( ! ( flags & URIBOOT_NO_SAN_UNHOOK ) ) {
 | 
		
	
		
			
			| 192 | 194 |  		if ( fetch_intz_setting ( NULL, &keep_san_setting ) == 0 ) {
 | 
		
	
		
			
			| 193 | 195 |  			san_unhook ( drive );
 | 
		
	
		
			
			| 194 | 196 |  			printf ( "Unregistered SAN device %#02x\n", drive );
 |