shithub: riscv

Download patch

ref: 744d6f83747ea6456ea270146ebfbb066445d30b
parent: cb02859888c7aa4bbd5ae598563458960b5a26e2
parent: c985da80d3a7aa6be1db7ea7cb034ec4e057d934
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Sat Jul 23 19:41:09 EDT 2011

merge

--- /dev/null
+++ b/rc/bin/troll
@@ -1,0 +1,2 @@
+#!/bin/rc
+fortune /sys/games/lib/trolls
--- a/sys/games/lib/fortunes
+++ b/sys/games/lib/fortunes
@@ -4535,3 +4535,8 @@
 I knew nothing about the PowerPC and had no idea how to modify my software to run on it. One August night, after dinner, two guys showed up to announce that they would camp out in my office until the modification was done. The three of us spent the next six hours editing fifty thousand lines of code.
 The secret to programming is having smart friends. -- Former Apple engineer
 <sl> at least he's not sexist.
+(#cat-v) <aiju> it's hard not to get trolled in #go-nuts
+Dickerson explained the change today on Etsy's blog, saying that his focus as the new CEO will be to impel Etsy to move faster "and more purposefully", and re-prioritize risk-taking and "learning by doing" and "iterating."
+(#cat-v) <cinap_lenrek> aiju: i had the correct code in my head
+Connection to Microsoft Exchange has been restored.
+/* ok for now. */
--- /dev/null
+++ b/sys/games/lib/trolls
@@ -1,0 +1,6 @@
+i'm so glad i live in europe and not america
+azns are such shitty drivers, they should all go back to wherever the fuck they came from and smash each others' cars there
+the wii is actually a pretty technically-advanced console compared to the ps3
+lighttpd is a great drop-in replacement for apache
+you shouldn't really run hdd speed tests under plan9 because the controller drivers are hacked-together open-source shit, something closed-source but official like windows would give a more accurate result
+the british empire had the right idea when they enslaved all those damn niggers
--- a/sys/man/1/fortune
+++ b/sys/man/1/fortune
@@ -1,11 +1,16 @@
 .TH FORTUNE 1
 .SH NAME
-fortune \- sample lines from a file
+fortune, troll \- sample lines from a file
 .SH SYNOPSIS
 .B fortune
 [
 .I file
 ]
+.br
+.B troll
+[
+.I file
+]
 .SH DESCRIPTION
 .I Fortune
 prints a one-line aphorism chosen at random.
@@ -14,10 +19,22 @@
 is specified, the saying is taken from that file;
 otherwise it is selected from
 .BR /sys/games/lib/fortunes .
+.LP
+.I
+Troll
+is more specific than
+.I fortune;
+it specializes in inflammatory rhetoric.
 .SH FILES
 .B /sys/games/lib/fortunes
 .br
 .B /sys/games/lib/fortunes.index
 \ \ fast lookup table, maintained automatically
+.br
+.B /sys/games/lib/trolls
 .SH SOURCE
 .B /sys/src/cmd/fortune.c
+.br
+.B /rc/bin/troll
+.SH AUTHORS
+Some initial trolls were provided by ChrisPBS.
--- a/sys/src/9/pc/etherbcm.c
+++ b/sys/src/9/pc/etherbcm.c
@@ -358,18 +358,16 @@
 			print("bcm: send queue full\n");
 			break;
 		}
-		if(incr == ctlr->sendcleani) {
-			bcmtransclean(edev, 0);
-			if(incr == ctlr->sendcleani)
-				break;
-		}
 		bp = qget(edev->oq);
 		if(bp == nil) break;
+		setmalloctag(bp, (ulong)(void*)bcmtransmit);
 		next = ctlr->sendr + ctlr->sendri * 4;
 		next[0] = 0;
 		next[1] = PADDR(bp->rp);
 		next[2] = (BLEN(bp) << 16) | PacketEnd;
 		next[3] = 0;
+		if(ctlr->sends[ctlr->sendri] != 0)
+			freeb(ctlr->sends[ctlr->sendri]);
 		ctlr->sends[ctlr->sendri] = bp;
 		csr32(ctlr, SendBDRingHostIndex) = ctlr->sendri = incr;
 	}
--- a/sys/src/cmd/acid/acid.h
+++ b/sys/src/cmd/acid/acid.h
@@ -27,7 +27,6 @@
 typedef struct Frtype	Frtype;
 
 Extern int	kernel;
-Extern int	remote;
 Extern int	text;
 Extern int	silent;
 Extern Fhdr	fhdr;
--- a/sys/src/cmd/acid/main.c
+++ b/sys/src/cmd/acid/main.c
@@ -60,19 +60,11 @@
 	case 'q':
 		quiet = 0;
 		break;
-	case 'r':
-		pid = 1;
-		remote++;
-		kernel++;
-		break;
 	default:
 		usage();
 	}ARGEND
 
 	if(argc > 0) {
-		if(remote)
-			aout = argv[0];
-		else
 		if(isnumeric(argv[0])) {
 			pid = strtol(argv[0], 0, 0);
 			snprint(prog, sizeof(prog), "/proc/%d/text", pid);
@@ -89,9 +81,7 @@
 			}
 			aout = argv[0];
 		}
-	} else
-	if(remote)
-		aout = "/mips/9ch";
+	}
 
 	fmtinstall('x', xfmt);
 	fmtinstall('L', Lfmt);
@@ -258,7 +248,6 @@
 	Value *v;
 	uvlong length;
 	Symbol sym;
-	extern Machdata mipsmach;
 
 	if(mtype != 0){
 		symmap = newmap(0, 1);
@@ -274,8 +263,6 @@
 		return;
 	}
 
-	machdata = &mipsmach;
-
 	if(!crackhdr(text, &fhdr)) {
 		print("can't decode file header\n");
 		return;
@@ -553,20 +540,19 @@
 	static char *kernel;
 
 	cpu = getenv("cputype");
-	if(cpu == 0) {
-		cpu = "mips";
-		print("$cputype not set; assuming %s\n", cpu);
-	}
+	if(cpu == 0)
+		sysfatal("$cputype not set");
 	p = getenv("terminal");
-	if(p == 0 || (p=strchr(p, ' ')) == 0 || p[1] == ' ' || p[1] == 0) {
-		p = "ch";
-		print("missing or bad $terminal; assuming %s\n", p);
-	}
+	if(p == 0 || (p=strchr(p, ' ')) == 0 || p[1] == ' ' || p[1] == 0)
+		sysfatal("$terminal not set");
 	else{
 		p++;
 		q = strchr(p, ' ');
 		if(q)
 			*q = 0;
+		q = strrchr(p, '/');
+		if(q)
+			p = q + 1;
 	}
 
 	if(kernel != nil)
--- a/sys/src/cmd/cwfs/malloc.c
+++ b/sys/src/cmd/cwfs/malloc.c
@@ -28,7 +28,7 @@
 			}
 		}
 		Bterm(bp);
-		if (pgsize > 0 && userused > userpgs)
+		if (pgsize > 0 && userused < userpgs)
 			return (userpgs - userused)*pgsize;
 	}
 	return 64*MB;