Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--support/serial.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/support/serial.c b/support/serial.c
index 74c54b0a21c..30542da9dd4 100644
--- a/support/serial.c
+++ b/support/serial.c
@@ -510,7 +510,15 @@ set_signal (int fd, MonoSerialSignal signal, gboolean value)
expected = get_signal_code (signal);
if (ioctl (fd, TIOCMGET, &signals) == -1)
- return -1;
+ {
+ /* Return successfully for pseudo-ttys.
+ * Linux kernels < 5.13 return EINVAL,
+ * but versions >=5.13 return ENOTTY. */
+ if (errno == EINVAL || errno == ENOTTY)
+ return 1;
+
+ return -1;
+ }
activated = (signals & expected) != 0;
if (activated == value) /* Already set */