From: Daniel Elstner Date: Fri, 11 Sep 2015 17:15:55 +0000 (+0200) Subject: session: Return immediately if there are no event sources X-Git-Tag: libsigrok-0.4.0~311 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ab0b34584c94349c12ad7b33fb6b52f4f1242755;p=libsigrok.git 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. --- diff --git a/src/session.c b/src/session.c index cc5f09dc..ad27a815 100644 --- a/src/session.c +++ b/src/session.c @@ -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);