]> sigrok.org Git - libsigrok.git/commitdiff
Use sdi->status instead of serial->fd to tell if port needs closing.
authorMartin Ling <redacted>
Sat, 7 Dec 2013 19:16:30 +0000 (19:16 +0000)
committerMartin Ling <redacted>
Sat, 7 Dec 2013 19:43:47 +0000 (19:43 +0000)
std.c

diff --git a/std.c b/std.c
index 415d1138b5529a372eb2c2d2b50a49e3444070ed..ab151198c07ad79d5ce522d0dcdc24611d9b84ec 100644 (file)
--- 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;
        }