X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=std.c;h=ab151198c07ad79d5ce522d0dcdc24611d9b84ec;hb=6936af3292b6a76a4ef5521fd8ea752333f13ae8;hp=1067c271542c2ff41ce03fdc7fe528a1b63ddbd0;hpb=043e899a5155dcdc353abc20006424973d8e2ed0;p=libsigrok.git diff --git a/std.c b/std.c index 1067c271..ab151198 100644 --- a/std.c +++ b/std.c @@ -231,12 +231,12 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver, return ret; } -SR_PRIV int std_serial_close(struct sr_dev_inst *sdi) +SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi) { struct sr_serial_dev_inst *serial; serial = sdi->conn; - if (serial && serial->fd != -1) { + if (serial && sdi->status == SR_ST_ACTIVE) { serial_close(serial); sdi->status = SR_ST_INACTIVE; }