games/doom: fix white window issue on exit

make kbdproc() and mouseproc() share fd table with the main proc
and not explicitely close the file descriptors. so /dev/mouse gets
closed *after* /dev/draw/new to avoid the white window refresh issue.
This commit is contained in:
cinap_lenrek 2016-01-30 19:11:33 +01:00
parent 7cfe4aef3c
commit 340d83d49d

View file

@ -46,13 +46,13 @@ void I_InitGraphics(void)
center = addpt(screen->r.min, Pt(Dx(screen->r)/2, Dy(screen->r)/2)); center = addpt(screen->r.min, Pt(Dx(screen->r)/2, Dy(screen->r)/2));
grabout = insetrect(screen->r, Dx(screen->r)/8); grabout = insetrect(screen->r, Dx(screen->r)/8);
if((pid = rfork(RFPROC|RFMEM|RFFDG)) == 0){ if((pid = rfork(RFPROC|RFMEM)) == 0){
kbdproc(); kbdproc();
exits(nil); exits(nil);
} }
kbdpid = pid; kbdpid = pid;
if((pid = rfork(RFPROC|RFMEM|RFFDG)) == 0){ if((pid = rfork(RFPROC|RFMEM)) == 0){
mouseproc(); mouseproc();
exits(nil); exits(nil);
} }
@ -300,7 +300,6 @@ kbdproc(void)
} }
strcpy(buf2, buf); strcpy(buf2, buf);
} }
close(kfd);
} }
static void static void
@ -356,6 +355,5 @@ mouseproc(void)
break; break;
} }
} }
close(fd);
} }