Skip to content

Commit

Permalink
Merge pull request #71 from scanse/serial-close
Browse files Browse the repository at this point in the history
Added close serial port to device_destruct in unix serial.cc
  • Loading branch information
kent-williams authored Apr 18, 2017
2 parents 8738b20 + c7cafac commit ffcc184
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libsweep/src/unix/serial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ void device_destruct(device_s serial) {

error_s ignore = nullptr;
device_flush(serial, &ignore);

if (close(serial->fd) == -1) {
SWEEP_ASSERT(false && "closing file descriptor during destruct failed");
}

(void)ignore; // nothing we can do here

delete serial;
Expand Down

0 comments on commit ffcc184

Please sign in to comment.