mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Exit with failure if the first dc_open method fails
If the dc_serial_*_open method fails then we should exit with an error and don't try to open the device using the native implementation. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									30a410036b
								
							
						
					
					
						commit
						813f6f502f
					
				
					 1 changed files with 4 additions and 7 deletions
				
			
		|  | @ -941,13 +941,10 @@ const char *do_libdivecomputer_import(device_data_t *data) | |||
| #endif | ||||
| 	} | ||||
| 
 | ||||
| 	if (serial_device) { | ||||
| 		if (rc == DC_STATUS_SUCCESS) { | ||||
| 			rc = dc_device_custom_open(&data->device, data->context, data->descriptor, serial_device); | ||||
| 		} else { | ||||
| 			report_error(errmsg(rc)); | ||||
| 		} | ||||
| 
 | ||||
| 	if (rc != DC_STATUS_SUCCESS) { | ||||
| 		report_error(errmsg(rc)); | ||||
| 	} else if (serial_device) { | ||||
| 		rc = dc_device_custom_open(&data->device, data->context, data->descriptor, serial_device); | ||||
| 	} else { | ||||
| #else | ||||
| 	{ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue