session: Return immediately if there are no event sources
Some drivers, such as zeroplus-logic-cube, run everything they do right away in dev_acquisition_start(), never installing any event sources. Handle that evilness by returning from sr_session_run() immediately if there are no sources.
This commit is contained in:
parent
c2bf5506ee
commit
ab0b34584c
|
@ -724,8 +724,8 @@ SR_API int sr_session_run(struct sr_session *session)
|
|||
return SR_ERR;
|
||||
}
|
||||
if (g_hash_table_size(session->event_sources) == 0) {
|
||||
sr_err("Refusing to run without any event sources.");
|
||||
return SR_ERR;
|
||||
sr_warn("No event sources, returning immediately.");
|
||||
return SR_OK;
|
||||
}
|
||||
|
||||
g_mutex_lock(&session->main_mutex);
|
||||
|
|
Loading…
Reference in New Issue