Use sdi->status instead of serial->fd to tell if port needs closing.

This commit is contained in:
Martin Ling 2013-12-07 19:16:30 +00:00
parent bf2c987fde
commit 6936af3292
1 changed files with 1 additions and 1 deletions

2
std.c
View File

@ -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;
}