summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index 3e4cfada7..3c699005e 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -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
{