Commit Diff


commit - 7f3d278a3bf42d174ac7e33bca180b7f4adc8310
commit + 0c7f940a724d3da79de887433ce89ad76cbf202a
blob - e62330a3e09ecb7e084fd5aaea3d0fb7be5cfcae
blob + 26e13f3949a54a6425aeadb28ae14b6ffdefd1e3
--- src/cmd/9term/9term.c
+++ src/cmd/9term/9term.c
@@ -97,8 +97,6 @@ threadmain(int argc, char *argv[])
 	keyboardctl = initkeyboard(nil);
 	if(keyboardctl == nil)
 		error("cannot find keyboard");
-	if((plumbfd = plumbopen("send", OWRITE)) < 0)
-		fprint(2, "9term: plumbopen: %r\n");
 	mouse = &mousectl->m;
 
 	winclosechan = chancreate(sizeof(Window*), 0);
@@ -523,7 +521,6 @@ riogetsnarf(void)
 	char *s;
 	int n, nb, nulls;
 
-fprint(2, "getsnarf\n");
 	s = getsnarf();
 	if(s == nil)
 		return;
blob - 2eb2e63872a1563c182bcb008ebf0c2ae7bbdd83
blob + 69dec8a7c900b41904ad2dd74e93d0861efb1bc6
--- src/cmd/9term/wind.c
+++ src/cmd/9term/wind.c
@@ -7,6 +7,7 @@
 #include <keyboard.h>
 #include <frame.h>
 #include <fcall.h>
+#include <9pclient.h>
 #include <plumb.h>
 #include <complete.h>
 #include "dat.h"
@@ -806,14 +807,14 @@ void
 wplumb(Window *w)
 {
 	Plumbmsg *m;
-	static int fd = -2;
+	static CFid *fd;
 	char buf[32];
 	uint p0, p1;
 	Cursor *c;
 
-	if(fd == -2)
-		fd = plumbopen("send", OWRITE|OCEXEC);
-	if(fd < 0)
+	if(fd == nil)
+		fd = plumbopenfid("send", OWRITE);
+	if(fd == nil)
 		return;
 	m = emalloc(sizeof(Plumbmsg));
 	m->src = estrdup("rio");
@@ -837,7 +838,7 @@ wplumb(Window *w)
 		return;	/* too large for 9P */
 	}
 	m->data = runetobyte(w->r+p0, p1-p0, &m->ndata);
-	if(plumbsend(fd, m) < 0){
+	if(plumbsendtofid(fd, m) < 0){
 		c = lastcursor;
 		riosetcursor(&query, 1);
 		sleep(300);