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:
authorcsanchezdll <csanchezdll@gmail.com>2020-08-31 16:15:09 +0300
committerGitHub <noreply@github.com>2020-08-31 16:15:09 +0300
commit59ee4edb6eec18eb6b651a61957ddba09e7d8434 (patch)
tree051d17ab4edbd2bc97b2343993b770a8e777593b /support
parentc58000534f16168a2de564a911cea9576053b5ef (diff)
Ignore EINVAL errors on ioctl TIOCMGET/TIOCMSET so (#20219)
pseudo-ttys are usable. (#20218)
Diffstat (limited to 'support')
-rw-r--r--support/serial.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/support/serial.c b/support/serial.c
index 74c54b0a21c..859dee81502 100644
--- a/support/serial.c
+++ b/support/serial.c
@@ -510,7 +510,13 @@ 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. */
+ if (errno == EINVAL)
+ return 1;
+
+ return -1;
+ }
activated = (signals & expected) != 0;
if (activated == value) /* Already set */