aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/samterm/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/samterm/main.c')
-rw-r--r--src/cmd/samterm/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cmd/samterm/main.c b/src/cmd/samterm/main.c
index ef958d78..79d3e0ec 100644
--- a/src/cmd/samterm/main.c
+++ b/src/cmd/samterm/main.c
@@ -32,6 +32,20 @@ threadmain(int argc, char *argv[])
Rectangle r;
Flayer *nwhich;
+ /*
+ * sam is talking to us on fd 0 and 1.
+ * move these elsewhere so that if we accidentally
+ * use 0 and 1 in other code, nothing bad happens.
+ */
+ dup(0, 3);
+ dup(1, 4);
+ hostfd[0] = 3;
+ hostfd[1] = 4;
+ close(0);
+ close(1);
+ open("/dev/null", OREAD);
+ dup(2, 1);
+
getscreen(argc, argv);
iconinit();
initio();