diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-02-27 02:39:45 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-02-27 02:39:45 +0100 |
commit | e02b986a801307d05e238c2af42b8a56f213f6ff (patch) | |
tree | 3e583a1f43ac35e78e32bc6c3b924405b850de7c /sys/src/cmd/rio/rio.c | |
parent | 09b250f079e38883e8ad5dc47e4aa93258e0c083 (diff) |
rio: exit rio when /dev/cons or /dev/kbd read loop terminates
Diffstat (limited to 'sys/src/cmd/rio/rio.c')
-rw-r--r-- | sys/src/cmd/rio/rio.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c index 29f5a024b..d8f7c78bf 100644 --- a/sys/src/cmd/rio/rio.c +++ b/sys/src/cmd/rio/rio.c @@ -194,6 +194,11 @@ threadmain(int argc, char *argv[]) exits("display open"); } iconinit(); + + exitchan = chancreate(sizeof(int), 0); + winclosechan = chancreate(sizeof(Window*), 0); + deletechan = chancreate(sizeof(char*), 0); + view = screen; viewr = view->r; mousectl = initmouse(nil, screen); @@ -209,10 +214,6 @@ threadmain(int argc, char *argv[]) draw(view, viewr, background, nil, ZP); flushimage(display, 1); - exitchan = chancreate(sizeof(int), 0); - winclosechan = chancreate(sizeof(Window*), 0); - deletechan = chancreate(sizeof(char*), 0); - timerinit(); threadcreate(keyboardthread, nil, STACK); threadcreate(mousethread, nil, STACK); @@ -1316,7 +1317,6 @@ kbdproc(void *arg) /* read kbd state */ while((n = read(kfd, buf, sizeof(buf))) > 0) chanprint(c, "%.*s", n, buf); - close(kfd); } else { /* read single characters */ p = buf; @@ -1337,6 +1337,7 @@ kbdproc(void *arg) p = buf + n; } } + send(exitchan, nil); } Channel* |