aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term/9term.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-12-26 21:37:31 +0000
committerrsc <devnull@localhost>2004-12-26 21:37:31 +0000
commit60535a5ff621d2e0f1eb91a08c0e624cc6c76fbd (patch)
treec3bdc4a7c60d477c3bbbdf07b8e4896d27440086 /src/cmd/9term/9term.c
parentf99790979b4a659d7f6e490fbb8b26d630804eed (diff)
downloadplan9port-60535a5ff621d2e0f1eb91a08c0e624cc6c76fbd.tar.gz
plan9port-60535a5ff621d2e0f1eb91a08c0e624cc6c76fbd.tar.bz2
plan9port-60535a5ff621d2e0f1eb91a08c0e624cc6c76fbd.zip
make work with new thread library
Diffstat (limited to 'src/cmd/9term/9term.c')
-rw-r--r--src/cmd/9term/9term.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c
index ffaf5291..7d79cc3e 100644
--- a/src/cmd/9term/9term.c
+++ b/src/cmd/9term/9term.c
@@ -20,7 +20,7 @@ enum
int noecho = 0;
void servedevtext(void);
-void listenthread(void*);
+void listenproc(void*);
void textthread(void*);
typedef struct Text Text;
@@ -249,7 +249,7 @@ threadmain(int argc, char *argv[])
initdraw(0, nil, "9term");
notify(hangupnote);
- notifyatsig(SIGCHLD, 1);
+ noteenable("sys: child");
servedevtext();
mc = initmouse(nil, screen);
@@ -322,7 +322,7 @@ hostproc(void *arg)
yield();
i = 1-i; /* toggle */
- n = threadread(rcfd, rcbuf[i].data, sizeof rcbuf[i].data);
+ n = read(rcfd, rcbuf[i].data, sizeof rcbuf[i].data);
if(n <= 0){
if(n < 0)
fprint(2, "9term: host read error: %r\n");
@@ -338,7 +338,7 @@ void
hoststart(void)
{
hostc = chancreate(sizeof(int), 0);
- threadcreate(hostproc, hostc, 32*1024);
+ proccreate(hostproc, hostc, 32*1024);
}
void
@@ -1868,25 +1868,25 @@ servedevtext(void)
}
putenv("text9term", buf);
- threadcreate(listenthread, nil, STACK);
+ proccreate(listenproc, nil, STACK);
strcpy(thesocket, buf+5);
atexit(removethesocket);
}
void
-listenthread(void *arg)
+listenproc(void *arg)
{
int fd;
char dir[100];
USED(arg);
for(;;){
- fd = threadlisten(adir, dir);
+ fd = listen(adir, dir);
if(fd < 0){
close(afd);
return;
}
- threadcreate(textthread, (void*)fd, STACK);
+ proccreate(textthread, (void*)fd, STACK);
}
}