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 2018-01-04 08:50:24 -08:00 committed by Jef Driesen
parent e22adbb3f9
commit 4e93b9a8f8

View File

@ -258,7 +258,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.