summaryrefslogtreecommitdiff
path: root/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch
blob: 07b7dba7be656c5ee4e24ae090e3c4546ea076c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Workaround tty corruption in crystal.

Patch restores blocking mode of file desriptors
in exchange of potential runtime deadlocks
when dealing with stdio.

Reported-by: Renich Bon Ciric
Bug: https://github.com/crystal-lang/crystal/issues/2065
Bug: https://bugs.gentoo.org/616256
diff --git a/src/compiler/crystal/stdio.cr b/src/compiler/crystal/stdio.cr
new file mode 100644
index 000000000..e65f65089
--- /dev/null
+++ b/src/compiler/crystal/stdio.cr
@@ -0,0 +1,5 @@
+module Crystal
+  STDIN.blocking = true
+  STDOUT.blocking=true
+  STDERR.blocking = true
+end