From: Martin Ling Date: Sat, 7 Dec 2013 19:16:30 +0000 (+0000) Subject: Use sdi->status instead of serial->fd to tell if port needs closing. X-Git-Tag: libsigrok-0.3.0~458 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=6936af3292b6a76a4ef5521fd8ea752333f13ae8 Use sdi->status instead of serial->fd to tell if port needs closing. --- 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; }