From 4e93b9a8f827d23b04e3acb41ae20825d0dcb6c7 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 4 Jan 2018 08:50:24 -0800 Subject: [PATCH] Cleanup: check return value of ioctl() It's checked for all the other invocations... Coverity CID 207796 Signed-off-by: Dirk Hohndel --- src/serial_posix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/serial_posix.c b/src/serial_posix.c index fecc018..356bc77 100644 --- a/src/serial_posix.c +++ b/src/serial_posix.c @@ -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.