]> sigrok.org Git - libsigrok.git/commitdiff
hung-chang-dso-2100: Fix session source fd
authorLars-Peter Clausen <redacted>
Sat, 23 Jan 2016 13:21:15 +0000 (14:21 +0100)
committerUwe Hermann <redacted>
Fri, 29 Jan 2016 17:24:42 +0000 (18:24 +0100)
For session sources without a file descriptor to poll a negative number
should be passed for the fd parameter. The hung-chang-dso-2100 driver
currently passes 0 instead, which is the stdin stream. Fix the issue by
passing -1 for the fd parameter.

Signed-off-by: Lars-Peter Clausen <redacted>
src/hardware/hung-chang-dso-2100/api.c

index b3b4634d23ed33faa733779616928a8ce4a04cf9..45fff2bc3b417f411385cbfd3302094d6d1cbcc1 100644 (file)
@@ -715,7 +715,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
 
        std_session_send_df_header(cb_data, LOG_PREFIX);
 
-       sr_session_source_add(sdi->session, 0, 0, 8,
+       sr_session_source_add(sdi->session, -1, 0, 8,
                              hung_chang_dso_2100_poll, (void *)sdi);
 
        return SR_OK;
@@ -730,7 +730,7 @@ SR_PRIV int hung_chang_dso_2100_dev_acquisition_stop(const struct sr_dev_inst *s
                return SR_ERR_DEV_CLOSED;
 
        sr_session_send(cb_data, &packet);
-       sr_session_source_remove(sdi->session, 0);
+       sr_session_source_remove(sdi->session, -1);
 
        hung_chang_dso_2100_move_to(sdi, 1);