From 1d6b88ee682be7909093b96a97ddcd368bbf1a0c Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 27 Sep 2017 16:44:56 -0700 Subject: [PATCH] AP_HAL_Linux: UARTDevice: never be the controlling terminal If we are the controlling terminal for a tty device we will receive a SIGHUP when the device disappears. Currently what happens is that we simply stop the whole process. We don't want to fall off the sky due to a bad device. This can happen for any reason, but it's more likely if the UART is behind a USB connection. --- libraries/AP_HAL_Linux/UARTDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_Linux/UARTDevice.cpp b/libraries/AP_HAL_Linux/UARTDevice.cpp index 20d22f2ee9..d4eda6cca5 100644 --- a/libraries/AP_HAL_Linux/UARTDevice.cpp +++ b/libraries/AP_HAL_Linux/UARTDevice.cpp @@ -33,7 +33,7 @@ bool UARTDevice::close() bool UARTDevice::open() { - _fd = ::open(_device_path, O_RDWR | O_CLOEXEC); + _fd = ::open(_device_path, O_RDWR | O_CLOEXEC | O_NOCTTY); if (_fd < 0) { ::fprintf(stderr, "Failed to open UART device %s - %s\n",