From: Lars-Peter Clausen Date: Sat, 23 Jan 2016 13:21:15 +0000 (+0100) Subject: hung-chang-dso-2100: Fix session source fd X-Git-Tag: libsigrok-0.4.0~11 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b165a24234b44a39e87661132ee0c92b49dac5ea;p=libsigrok.git hung-chang-dso-2100: Fix session source fd 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 --- diff --git a/src/hardware/hung-chang-dso-2100/api.c b/src/hardware/hung-chang-dso-2100/api.c index b3b4634d..45fff2bc 100644 --- a/src/hardware/hung-chang-dso-2100/api.c +++ b/src/hardware/hung-chang-dso-2100/api.c @@ -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);