diff options
author | rsc <devnull@localhost> | 2003-10-11 02:45:02 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2003-10-11 02:45:02 +0000 |
commit | 941c9f36a9230690989f495313a399af5192ef5c (patch) | |
tree | 3cf12a8041aa91159007bd5e36ed02a3a27e7ee6 /src/cmd/samterm/main.c | |
parent | 079d45c20eb7fc6ec398c602798888a39000da68 (diff) | |
download | plan9port-941c9f36a9230690989f495313a399af5192ef5c.tar.gz plan9port-941c9f36a9230690989f495313a399af5192ef5c.tar.bz2 plan9port-941c9f36a9230690989f495313a399af5192ef5c.zip |
Tweaks to make it work on Unix.
Diffstat (limited to 'src/cmd/samterm/main.c')
-rw-r--r-- | src/cmd/samterm/main.c | 14 |
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(); |