serial: Check that port is open before reading or writing
This change adds checks to the platform-specific implementations of Read() and Write() to make sure that the file descriptor is valid before. This makes the assumptions validated by later DCHECK correct. This cannot be done in the platform-independent layer because test code depends on being able to call some SerialIoHandler methods without an actual file descriptor. Bug: 1121836 Change-Id: If182404cf10a2f3b445b9c80b75fed5df6b5ab4b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2393001Reviewed-by:James Hollyer <jameshollyer@chromium.org> Commit-Queue: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#805016}
Showing
Please register or sign in to comment