shithub: plan9front

Download patch

ref: 1c30bd451e1813f1cf9f9db4d7c1a4f3f95d1e37
parent: 73db7a20f7a3195967d77b972e4eaa5602d2d4bf
author: Fulton Browne <git@fulton.software>
date: Sat Jun 12 13:20:53 EDT 2021

B, sam: remove sam srv file
No need for 2 programs doing the same job.

--- a/rc/bin/B	Sat Jun 12 10:57:58 2021
+++ b/rc/bin/B	Sat Jun 12 13:20:53 2021
@@ -16,27 +16,4 @@
 	exit
 }
 
-# using sam srv file
-
-for(i)
-	switch($i){
-	case /*
-		files = ( $files $i )
-	case *
-		files = ( $files `{cleanname `{pwd}^/$i} )
-	}
-
-if(test -f /mnt/term/srv/sam.$user) dest = /mnt/term/srv/sam.$user
-if not if(test -f /srv/sam.$user) dest = /srv/sam.$user
-if not {
-	echo B: can''''t find sam server file >[1=2]
-	exit open
-}
-
-switch($files){
-case *:*
-	for(i in $files)
-		echo $i | sed 's/^/B /;s/:([0-9]+)$/\n\1/g' >> $dest
-case *
-	echo B $files >> $dest
-}
+echo 'no plumber' >[1=2]
--- a/sys/src/cmd/samterm/io.c	Sat Jun 12 10:57:58 2021
+++ b/sys/src/cmd/samterm/io.c	Sat Jun 12 13:20:53 2021
@@ -43,8 +43,7 @@
 		threadexitsall("kbd");
 	}
 	hoststart();
-	if(plumbstart() < 0)
-		extstart();
+	plumbstart();
 }
 
 void
--- a/sys/src/cmd/samterm/plan9.c	Sat Jun 12 10:57:58 2021
+++ b/sys/src/cmd/samterm/plan9.c	Sat Jun 12 13:20:53 2021
@@ -147,39 +147,6 @@
 	}
 }
 
-void
-extstart(void)
-{
-	char buf[32];
-	int fd;
-	static int p[2];
-	static void *arg[2];
-
-	if(pipe(p) < 0)
-		return;
-	sprint(exname, "/srv/sam.%s", getuser());
-	fd = create(exname, 1, 0600);
-	if(fd < 0){	/* assume existing guy is more important */
-    Err:
-		close(p[0]);
-		close(p[1]);
-		return;
-	}
-	sprint(buf, "%d", p[0]);
-	if(write(fd, buf, strlen(buf)) <= 0)
-		goto Err;
-	close(fd);
-	/*
-	 * leave p[0] open so if the file is removed the event
-	 * library won't get an error
-	 */
-	plumbc = chancreate(sizeof(int), 0);
-	arg[0] = plumbc;
-	arg[1] = &p[1];
-	proccreate(extproc, arg, STACK);
-	atexit(removeextern);
-}
-
 int
 plumbformat(int i)
 {
--- a/sys/src/cmd/samterm/samterm.h	Sat Jun 12 10:57:58 2021
+++ b/sys/src/cmd/samterm/samterm.h	Sat Jun 12 13:20:53 2021
@@ -103,7 +103,6 @@
 void	getmouse(void);
 void	mouseunblock(void);
 void	kbdblock(void);
-void	extstart(void);
 void	hoststart(void);
 int	plumbstart(void);
 int	button(int but);