diff options
| author | rsc <devnull@localhost> | 2004-04-15 02:04:30 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-04-15 02:04:30 +0000 |
| commit | 4dcd9af228643d37bb63ab1642c5128b3b30f4bd (patch) | |
| tree | 5fb7111b84b44aa4da4126f43d2545c45ce0e6e5 /src/cmd/9term/rcstart.c | |
| parent | aeb54c0efed03187235820c73b7feef2260951cf (diff) | |
| download | plan9port-4dcd9af228643d37bb63ab1642c5128b3b30f4bd.tar.gz plan9port-4dcd9af228643d37bb63ab1642c5128b3b30f4bd.zip | |
9term manages to turn off echo at the right times under SunOS ?
Diffstat (limited to 'src/cmd/9term/rcstart.c')
| -rw-r--r-- | src/cmd/9term/rcstart.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/cmd/9term/rcstart.c b/src/cmd/9term/rcstart.c index ec168e99..499c5918 100644 --- a/src/cmd/9term/rcstart.c +++ b/src/cmd/9term/rcstart.c @@ -1,11 +1,21 @@ #include <u.h> #include <libc.h> +#if 0 +#include <sys/wait.h> +#endif +#include <signal.h> #include "term.h" +/* + * Somehow we no longer automatically exit + * when the shell exits; hence the SIGCHLD stuff. + * Something that can be fixed? Axel. + */ +static int pid; + int -rcstart(int argc, char **argv, int *pfd) +rcstart(int argc, char **argv, int *pfd, int *tfd) { - int pid; int fd[2]; char *xargv[3]; char slave[256]; @@ -27,7 +37,6 @@ rcstart(int argc, char **argv, int *pfd) if(getpts(fd, slave) < 0) sysfatal("getpts: %r\n"); - switch(pid = fork()) { case 0: putenv("TERM", "9term"); @@ -44,8 +53,11 @@ rcstart(int argc, char **argv, int *pfd) sysfatal("proc failed: %r"); break; } - close(fd[0]); *pfd = fd[1]; + if(tfd) + *tfd = fd[0]; + else + close(fd[0]); return pid; } |
