shithub: riscv

Download patch

ref: 0181117b5f56341e71f72f1cda37e815853eaacc
parent: fef5c8e4caf7a673e81d733c11e6410f8e427623
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Feb 21 00:32:20 EST 2014

fork filter procs with RFREND in various programs

--- a/sys/src/cmd/cpu.c
+++ b/sys/src/cmd/cpu.c
@@ -301,7 +301,7 @@
 	if(pipe(p) < 0)
 		fatal("pipe: %r");
 
-	switch(rfork(RFPROC|RFMEM|RFFDG|RFNAMEG)) {
+	switch(rfork(RFPROC|RFMEM|RFFDG|RFNAMEG|RFREND)) {
 	case -1:
 		fatal("rfork srvold9p: %r");
 	case 0:
@@ -760,7 +760,7 @@
 	if(filterp == nil)
 		return fd;
 	procsetname("filter %s", filterp);
-	flags = RFNOWAIT|RFPROC|RFMEM|RFFDG;
+	flags = RFNOWAIT|RFPROC|RFMEM|RFFDG|RFREND;
 	if(host == nil){
 		/* remote side */
 		if(announce(anstring, addr) < 0)
--- a/sys/src/cmd/page.c
+++ b/sys/src/cmd/page.c
@@ -1404,7 +1404,7 @@
 		fd = dup(fd, -1);
 		seek(fd, 0, 0);
 	}
-	if(rfork(RFPROC|RFMEM|RFFDG|RFNOTEG|RFNOWAIT) == 0){
+	if(rfork(RFPROC|RFMEM|RFFDG|RFNOTEG|RFREND|RFNOWAIT) == 0){
 		if(newwindow(nil) != -1){
 			dupfds(fd, open("/dev/cons", OWRITE), open("/dev/cons", OWRITE), -1);
 			if((fd = open("/dev/label", OWRITE)) >= 0){
--- a/sys/src/cmd/paint.c
+++ b/sys/src/cmd/paint.c
@@ -562,7 +562,7 @@
 	va_end(a);
 	if(pipe(p) < 0)
 		return -1;
-	switch(rfork(RFPROC|RFMEM|RFFDG|RFNOTEG)){
+	switch(rfork(RFPROC|RFMEM|RFFDG|RFNOTEG|RFREND)){
 	case -1:
 		close(p[0]);
 		close(p[1]);