From 077613efc501195f4ad0018e9d94f848654f6c3e Mon Sep 17 00:00:00 2001 From: Steve Markgraf Date: Mon, 26 Aug 2019 19:26:30 +0200 Subject: improve exit handling on device removal --- src/fl2k_file.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/fl2k_file.c') diff --git a/src/fl2k_file.c b/src/fl2k_file.c index 80ddcad..5ae199b 100644 --- a/src/fl2k_file.c +++ b/src/fl2k_file.c @@ -85,6 +85,12 @@ void fl2k_callback(fl2k_data_info_t *data_info) int r, left = FL2K_BUF_LEN; static uint32_t repeat_cnt = 0; + if (data_info->device_error) { + fprintf(stderr, "Device error, exiting.\n"); + do_exit = 1; + return; + } + data_info->sampletype_signed = 1; data_info->r_buf = txbuf; -- cgit v1.2.3