Use sdi->status instead of serial->fd to tell if port needs closing.
This commit is contained in:
parent
bf2c987fde
commit
6936af3292
2
std.c
2
std.c
|
@ -236,7 +236,7 @@ SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi)
|
||||||
struct sr_serial_dev_inst *serial;
|
struct sr_serial_dev_inst *serial;
|
||||||
|
|
||||||
serial = sdi->conn;
|
serial = sdi->conn;
|
||||||
if (serial && serial->fd != -1) {
|
if (serial && sdi->status == SR_ST_ACTIVE) {
|
||||||
serial_close(serial);
|
serial_close(serial);
|
||||||
sdi->status = SR_ST_INACTIVE;
|
sdi->status = SR_ST_INACTIVE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue