mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
Return the actual libdivecomputer error code
The divecomputer_device_open() function tries all supported transports one by one, and exits as soon as one is opened successfully. When the end of the function is reached, the DC_STATUS_UNSUPPORTED error code is returned. The annoying side effect is that the actual error code returned by the transport is ignored and changed into DC_STATUS_UNSUPPORTED. This is very confusing while troubleshooting download problems. Fixed by initializing the error code to DC_STATUS_UNSUPPORTED, in case no transport is available for trying, and returning the last reported error to caller. Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
This commit is contained in:
parent
2a3c0d981f
commit
1abf400c63
1 changed files with 2 additions and 2 deletions
|
@ -1343,7 +1343,7 @@ static dc_status_t bluetooth_device_open(dc_context_t *context, device_data_t *d
|
||||||
|
|
||||||
dc_status_t divecomputer_device_open(device_data_t *data)
|
dc_status_t divecomputer_device_open(device_data_t *data)
|
||||||
{
|
{
|
||||||
dc_status_t rc;
|
dc_status_t rc = DC_STATUS_UNSUPPORTED;
|
||||||
dc_context_t *context = data->context;
|
dc_context_t *context = data->context;
|
||||||
unsigned int transports, supported;
|
unsigned int transports, supported;
|
||||||
|
|
||||||
|
@ -1423,7 +1423,7 @@ dc_status_t divecomputer_device_open(device_data_t *data)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DC_STATUS_UNSUPPORTED;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static dc_status_t sync_divecomputer_time(dc_device_t *device)
|
static dc_status_t sync_divecomputer_time(dc_device_t *device)
|
||||||
|
|
Loading…
Reference in a new issue