Safely call hackrf_close() after resetting the HackRF
This commit is contained in:
@ -313,15 +313,15 @@ int main(int argc, char** argv)
|
|||||||
fd = NULL;
|
fd = NULL;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
result = hackrf_close(device);
|
|
||||||
if (result != HACKRF_SUCCESS) {
|
result = hackrf_close(device);
|
||||||
fprintf(stderr, "hackrf_close() failed: %s (%d)\n",
|
if (result != HACKRF_SUCCESS) {
|
||||||
hackrf_error_name(result), result);
|
fprintf(stderr, "hackrf_close() failed: %s (%d)\n",
|
||||||
fclose(fd);
|
hackrf_error_name(result), result);
|
||||||
fd = NULL;
|
fclose(fd);
|
||||||
return EXIT_FAILURE;
|
fd = NULL;
|
||||||
}
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
hackrf_exit();
|
hackrf_exit();
|
||||||
|
Reference in New Issue
Block a user