chiark / gitweb /
add TIOCNOTTY ioctl wrapper
authorColin Watson <cjwatson@chiark.greenend.org.uk>
Mon, 24 Nov 2008 19:43:17 +0000 (19:43 +0000)
committerColin Watson <cjwatson@chiark.greenend.org.uk>
Mon, 24 Nov 2008 19:43:17 +0000 (19:43 +0000)
tiocnotty [new file with mode: 0755]

diff --git a/tiocnotty b/tiocnotty
new file mode 100755 (executable)
index 0000000..1bf635e
--- /dev/null
+++ b/tiocnotty
@@ -0,0 +1,15 @@
+#! /usr/bin/python
+
+import sys
+import os
+import fcntl
+import termios
+
+try:
+    tty = open('/dev/tty')
+    fcntl.ioctl(tty, termios.TIOCNOTTY)
+    tty.close()
+except IOError:
+    pass
+
+os.execvp(sys.argv[1], sys.argv[1:])