This commit is contained in:
cinap_lenrek 2011-07-23 23:41:09 +02:00
commit 744d6f8374
8 changed files with 43 additions and 30 deletions

2
rc/bin/troll Normal file
View file

@ -0,0 +1,2 @@
#!/bin/rc
fortune /sys/games/lib/trolls

View file

@ -4535,3 +4535,8 @@ The cast spent three weeks learning how to type, rollerblade and got to know eac
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. */

6
sys/games/lib/trolls Normal file
View file

@ -0,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

View file

@ -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 @@ If a
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.

View file

@ -358,18 +358,16 @@ bcmtransmit(Ether *edev)
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;
}

View file

@ -27,7 +27,6 @@ typedef struct Type Type;
typedef struct Frtype Frtype;
Extern int kernel;
Extern int remote;
Extern int text;
Extern int silent;
Extern Fhdr fhdr;

View file

@ -60,19 +60,11 @@ main(int argc, char *argv[])
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 @@ main(int argc, char *argv[])
}
aout = argv[0];
}
} else
if(remote)
aout = "/mips/9ch";
}
fmtinstall('x', xfmt);
fmtinstall('L', Lfmt);
@ -258,7 +248,6 @@ readtext(char *s)
Value *v;
uvlong length;
Symbol sym;
extern Machdata mipsmach;
if(mtype != 0){
symmap = newmap(0, 1);
@ -274,8 +263,6 @@ readtext(char *s)
return;
}
machdata = &mipsmach;
if(!crackhdr(text, &fhdr)) {
print("can't decode file header\n");
return;
@ -553,20 +540,19 @@ system(void)
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)

View file

@ -28,7 +28,7 @@ memsize(void)
}
}
Bterm(bp);
if (pgsize > 0 && userused > userpgs)
if (pgsize > 0 && userused < userpgs)
return (userpgs - userused)*pgsize;
}
return 64*MB;