X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=std.c;h=ab151198c07ad79d5ce522d0dcdc24611d9b84ec;hb=6936af3292b6a76a4ef5521fd8ea752333f13ae8;hp=415d1138b5529a372eb2c2d2b50a49e3444070ed;hpb=bf2c987fdef6787a5ce826ed9d98a70f52a1ff96;p=libsigrok.git diff --git a/std.c b/std.c index 415d1138..ab151198 100644 --- a/std.c +++ b/std.c @@ -236,7 +236,7 @@ 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; }