Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rc/bin/termrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ NDBFILE=/lib/ndb/local

mntgen -s slashn && chmod 666 /srv/slashn

# parallelism for mk
NPROC = `{wc -l /dev/sysstat}

# bind all likely devices (#S was bound in boot)
for(i in f t m v L P u U '$' Σ κ)
/bin/bind -a '#'^$i /dev >/dev/null >[2=1]
Expand Down
6 changes: 5 additions & 1 deletion sys/src/9k/ip/iproute.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,9 @@ routewrite(Fs *f, Chan *c, char *p, int n)
nexterror();
}

if(cb->nf < 1)
error("short control request");

if(strcmp(cb->f[0], "flush") == 0){
tag = cb->f[1];
for(h = 0; h < nelem(f->v4root); h++)
Expand Down Expand Up @@ -880,7 +883,8 @@ routewrite(Fs *f, Chan *c, char *p, int n)
print("no route\n");
else
printroute(q);
}
} else
error(Ebadctl);

poperror();
free(cb);
Expand Down
10 changes: 5 additions & 5 deletions sys/src/9k/port/devtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static TlsErrs tlserrs[] = {
enum
{
/* max. open tls connections */
MaxTlsDevs = 1024
MaxTlsDevs = 16*1024
};

static Lock tdlock;
Expand Down Expand Up @@ -769,8 +769,8 @@ if(tr->debug)pprint("consumed %d header\n", RecHdrLen);
if(ver != tr->version && (tr->verset || ver < MinProtoVersion || ver > MaxProtoVersion))
rcvError(tr, EProtocolVersion, "devtls expected ver=%x%s, saw (len=%d) type=%x ver=%x '%.12s'",
tr->version, tr->verset?"/set":"", len, type, ver, (char*)header);
if(len > MaxCipherRecLen || len < 0)
rcvError(tr, ERecordOverflow, "record message too long %d", len);
if(len > MaxCipherRecLen || len <= 0)
rcvError(tr, ERecordOverflow, "bad record message length %d", len);
ensure(tr, &tr->unprocessed, len);
nconsumed = 0;
poperror();
Expand Down Expand Up @@ -1255,7 +1255,8 @@ tlsrecwrite(TlsRec *tr, int type, Block *b)
if(tr->debug)pprint("send %ld\n", BLEN(b));
if(tr->debug)pdump(BLEN(b), b->rp, "sent:");


if(type == RApplication)
checkstate(tr, 0, SOpen);
ok = SHandshake|SOpen|SRClose;
if(type == RAlert)
ok |= SAlert;
Expand Down Expand Up @@ -1372,7 +1373,6 @@ tlsbwrite(Chan *c, Block *b, vlong offset)
tr->handout += n;
break;
case Qdata:
checkstate(tr, 0, SOpen);
tlsrecwrite(tr, RApplication, b);
tr->dataout += n;
break;
Expand Down
8 changes: 3 additions & 5 deletions sys/src/9k/port/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ rebalance(void)
p = rq->head;
if(p == nil)
continue;
if(p->mp != m)
continue;
if(pri == p->basepri)
continue;
updatecpu(p);
Expand Down Expand Up @@ -1052,7 +1050,7 @@ pexit(char *exitstr, int freemem)
* if not a kernel process and have a parent,
* do some housekeeping.
*/
if(up->kp == 0) {
if(up->kp == 0 && up->parentpid != 0) {
p = up->parent;
if(p == nil) {
if(exitstr == nil)
Expand Down Expand Up @@ -1087,13 +1085,13 @@ pexit(char *exitstr, int freemem)
p->time[TCUser] += utime;
p->time[TCSys] += stime;
/*
* If there would be more than 128 wait records
* If there would be more than 2000 wait records
* processes for my parent, then don't leave a wait
* record behind. This helps prevent badly written
* daemon processes from accumulating lots of wait
* records.
*/
if(p->nwait < 128) {
if(p->nwait < 2000) {
wq->next = p->waitq;
p->waitq = wq;
p->nwait++;
Expand Down
15 changes: 8 additions & 7 deletions sys/src/9k/port/sysproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,6 @@ sysexec(Ar0* ar0, va_list list)
up->nargs = nargs;
poperror(); /* args */

/*
* Close on exec
*/
f = up->fgrp;
for(i=0; i<=f->maxfd; i++)
fdclose(i, CCEXEC);

/*
* Free old memory.
* Special segments maintained across exec.
Expand Down Expand Up @@ -602,6 +595,7 @@ sysexec(Ar0* ar0, va_list list)
mmuflush();
qlock(&up->debug);
up->nnote = 0;
up->notepending = 0;
up->notify = 0;
up->notified = 0;
up->privatemem = 0;
Expand All @@ -610,6 +604,13 @@ sysexec(Ar0* ar0, va_list list)
if(up->hang)
up->procctl = Proc_stopme;

/*
* Close on exec
*/
f = up->fgrp;
for(i=0; i<=f->maxfd; i++)
fdclose(i, CCEXEC);

ar0->v = sysexecregs(entry, TSTKTOP - PTR2UINT(argv), argc);
}

Expand Down
4 changes: 3 additions & 1 deletion sys/src/cmd/ndb/dblookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,12 @@ db2cache(int doit)

/* remove old entries */
dnageall(1);
} else
} else {
dnpurge();
/* read all the soa's to get database defaults */
for(ndb = db; ndb; ndb = ndb->next)
dbfile2area(ndb);
}

doit = 0;
lastyoungest = youngest;
Expand Down