Browse Source

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.
mission-4.1.18
Lucas De Marchi 7 years ago
parent
commit
4d5aed1d69
  1. 2
      libraries/AP_HAL_Linux/UARTDevice.cpp

2
libraries/AP_HAL_Linux/UARTDevice.cpp

@ -33,7 +33,7 @@ bool UARTDevice::close()
bool UARTDevice::open() bool UARTDevice::open()
{ {
_fd = ::open(_device_path, O_RDWR | O_CLOEXEC); _fd = ::open(_device_path, O_RDWR | O_CLOEXEC | O_NOCTTY);
if (_fd < 0) { if (_fd < 0) {
::fprintf(stderr, "Failed to open UART device %s - %s\n", ::fprintf(stderr, "Failed to open UART device %s - %s\n",

Loading…
Cancel
Save