Cleanup: check return value of ioctl()

It's checked for all the other invocations...

Coverity CID 207796

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-12-28 15:24:59 -08:00
parent 6b2757955f
commit b9a398d4ab

View File

@ -262,7 +262,11 @@ dc_serial_close (dc_iostream_t *abstract)
#ifndef ENABLE_PTY
// Disable exclusive access mode.
ioctl (device->fd, TIOCNXCL, NULL);
if (ioctl (device->fd, TIOCNXCL, NULL)) {
int errcode = errno;
SYSERROR (abstract->context, errcode);
dc_status_set_error(&status, syserror (errcode));
}
#endif
// Close the device.