]> sigrok.org Git - libsigrok.git/commitdiff
session: Return immediately if there are no event sources
authorDaniel Elstner <redacted>
Fri, 11 Sep 2015 17:15:55 +0000 (19:15 +0200)
committerDaniel Elstner <redacted>
Fri, 11 Sep 2015 17:15:55 +0000 (19:15 +0200)
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.

src/session.c

index cc5f09dccb607910d3cb4ef62789203114bf6aaf..ad27a8152c610e35c1fa40d72f46214c82d48f56 100644 (file)
@@ -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);