shithub: cflood

Download patch

ref: 59b55c84a56366ef92c8288398902e9330120207
parent: 24784c25acafe9837586ef877b6cc7960a880a83
author: Sigrid Solveig Haflínudóttir <248148+ftrvxmtrx@users.noreply.github.com>
date: Tue Dec 18 19:25:43 EST 2012

remove crap

diff: cannot open a/kbd//null: file does not exist: 'a/kbd//null'
--- a/kbd/kbdbind.c
+++ /dev/null
@@ -1,72 +1,0 @@
-#include <u.h>
-#include <libc.h>
-
-enum {
-	NumF = 12
-};
-
-static char *funcs[NumF];
-
-void main(int, char**) {
-	funcs[0] = "Fi";
-	funcs[1] = "Ru";
-	funcs[2] = "window";
-
-	int in = open("/dev/kbd", OREAD);
-	if(in < 0)
-		sysfatal("open failed: %r");
-
-	int p[2];
-	pipe(p);
-	int fd = create("/srv/kbdbind", OWRITE, 0600);
-	if(fd < 0)
-		sysfatal("create failed: %r");
-	fprint(fd, "%d", p[0]);
-	close(fd);
-	close(p[0]);
-	int out = p[1];
-
-	for(;;) {
-		uchar b[128];
-		long size = read(in, b, sizeof(b));
-
-		if(size < 0)
-			break;
-		for(long i = 0; i < size;) {
-			int isfunc =
-				size >= 5 &&
-				(b[i] == 'k' || b[i] == 'c') &&
-				b[i+1] == 0xef &&
-				b[i+2] == 0x80 &&
-				(b[i+3] >= 0x81 && b[i+3] <= (0x81+NumF));
-			int funcid = isfunc ? b[i+3] - 0x81 : -1;
-
-			if(funcid < 0 || funcs[funcid] == nil) {
-				int k = i;
-				for(; i < size; i++) {
-					if(!b[i]) {
-						i++;
-						break;
-					}
-				}
-				if(i - k > 0) {
-					write(out, &b[k], i - k);
-				}
-			} else {
-				int down = b[i] == 'k';
-				i += 5;
-				if(!down)
-					continue;
-				switch(rfork(RFFDG|RFREND|RFPROC|RFNOWAIT)) {
-				case 0:
-					if(execl("/bin/rc", "/bin/rc", funcs[funcid], 0) < 0)
-						fprint(2, "execl failed: %r");
-					break;
-				case -1:
-					fprint(2, "rfork failed: %r");
-					break;
-				}
-			}
-		}
-	}
-}
--- a/kbd/mkfile
+++ /dev/null
@@ -1,7 +1,0 @@
-</$objtype/mkfile
-
-TARG=kbdbind
-OFILES=kbdbind.$O
-BIN=/$objtype/bin
-
-</sys/src/cmd/mkone
--- a/kbd/rio-kbd-file-option.patch
+++ /dev/null
@@ -1,92 +1,0 @@
-diff -r 9e12b43399af sys/man/1/rio
---- a/sys/man/1/rio	Fri Dec 14 17:16:50 2012 +0100
-+++ b/sys/man/1/rio	Sun Dec 16 22:38:55 2012 +0100
-@@ -10,6 +10,9 @@
- .BI "-k '"kbdcmd '
- ]
- [
-+.BI "-K '"kbdfile '
-+]
-+[
- .B -s
- ]
- [
-@@ -89,6 +92,14 @@
- program described in
- .IR bitsyload (1)
- is the usual choice.
-+The
-+.B -K
-+option instructs
-+.I rio
-+to read keyboard input from
-+.I kbdfile
-+instead of a default
-+.BR /dev/kbd .
- .PP
- The
- .B -s
-diff -r 9e12b43399af sys/man/4/rio
---- a/sys/man/4/rio	Fri Dec 14 17:16:50 2012 +0100
-+++ b/sys/man/4/rio	Sun Dec 16 22:38:55 2012 +0100
-@@ -12,6 +12,10 @@
- .BI ' kbdcmd '
- ]
- [
-+.B -K
-+.BI ' kbdfile '
-+]
-+[
- .B -s
- ]
- [
-diff -r 9e12b43399af sys/src/cmd/rio/rio.c
---- a/sys/src/cmd/rio/rio.c	Fri Dec 14 17:16:50 2012 +0100
-+++ b/sys/src/cmd/rio/rio.c	Sun Dec 16 22:38:55 2012 +0100
-@@ -45,6 +45,7 @@
- Channel* initkbd(void);
- 
- char		*fontname;
-+char		*kbdname;
- 
- enum
- {
-@@ -112,7 +113,7 @@
- void
- usage(void)
- {
--	fprint(2, "usage: rio [-b] [-f font] [-i initcmd] [-k kbdcmd] [-s]\n");
-+	fprint(2, "usage: rio [-b] [-f font] [-i initcmd] [-k kbdcmd] [-K kbdfile] [-s]\n");
- 	exits("usage");
- }
- 
-@@ -153,6 +154,11 @@
- 		if(kbdin == nil)
- 			usage();
- 		break;
-+	case 'K':
-+		kbdname = ARGF();
-+		if(kbdname == nil)
-+			usage();
-+		break;
- 	case 's':
- 		scrolling = TRUE;
- 		break;
-@@ -164,6 +170,8 @@
- 		startdir = estrdup(buf);
- 	if(fontname == nil)
- 		fontname = getenv("font");
-+	if(kbdname == nil)
-+		kbdname = "/dev/kbd";
- 	s = getenv("tabstop");
- 	if(s != nil)
- 		maxtab = strtol(s, nil, 0);
-@@ -1302,7 +1310,7 @@
- 	if(sendp(c, nil) <= 0)
- 		return;
- 
--	if((kfd = open("/dev/kbd", OREAD)) >= 0){
-+	if((kfd = open(kbdname, OREAD)) >= 0){
- 		close(fd);
- 
- 		/* read kbd state */