upas/fs: remove more debugging crap
This commit is contained in:
parent
75bca30647
commit
4b08ef2c55
4 changed files with 1 additions and 54 deletions
|
@ -1,40 +0,0 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
|
||||
/*
|
||||
* assume:
|
||||
* - the stack segment can't be resized
|
||||
* - stacks may not be segattached (by name Stack, anyway)
|
||||
* - no thread library
|
||||
*/
|
||||
uintptr
|
||||
absbos(void)
|
||||
{
|
||||
char buf[64], *f[10], *s, *r;
|
||||
int n;
|
||||
uintptr p, q;
|
||||
Biobuf *b;
|
||||
|
||||
p = 0xd0000000; /* guess pc kernel */
|
||||
snprint(buf, sizeof buf, "/proc/%ud/segment", getpid());
|
||||
b = Bopen(buf, OREAD);
|
||||
if(b == nil)
|
||||
return p;
|
||||
for(; s = Brdstr(b, '\n', 1); free(s)){
|
||||
if((n = tokenize(s, f, nelem(f))) < 3)
|
||||
continue;
|
||||
if(strcmp(f[0], "Stack") != 0)
|
||||
continue;
|
||||
/*
|
||||
* addressing from end because segment
|
||||
* flags could become discontiguous if
|
||||
* additional flags are added
|
||||
*/
|
||||
q = strtoull(f[n - 3], &r, 16);
|
||||
if(*r == 0 && (char*)q > end)
|
||||
p = q;
|
||||
}
|
||||
Bterm(b);
|
||||
return p;
|
||||
}
|
|
@ -133,21 +133,13 @@ static Hash *htab[Hsize];
|
|||
static Fcall rhdr;
|
||||
static Fcall thdr;
|
||||
static Fid *fids;
|
||||
static uintptr bos = 0xd0000000; /* pc kernel specific */
|
||||
|
||||
#define onstack(x) ((uintptr)(x) >= bos)
|
||||
#define intext(x) ((char*)(x) <= end)
|
||||
#define validgptr(x) assert(!onstack(x) && !intext(x))
|
||||
void
|
||||
sanemsg(Message *m)
|
||||
{
|
||||
if(bos == 0)
|
||||
bos = absbos();
|
||||
assert(m->refs < 100);
|
||||
validgptr(m->whole);
|
||||
if(debug)
|
||||
poolcheck(mainmem);
|
||||
validgptr(m);
|
||||
assert(m->refs < 100);
|
||||
assert(m->next != m);
|
||||
if(m->end < m->start)
|
||||
abort();
|
||||
|
|
|
@ -483,8 +483,6 @@ parseheaders(Mailbox *mb, Message *m, int addfrom, int justmime)
|
|||
int i, i0, n;
|
||||
uintptr a;
|
||||
|
||||
/*sanembmsg(mb, m); /* fails with pop but i want this debugging for now */
|
||||
|
||||
/* parse mime headers */
|
||||
p = m->header;
|
||||
i0 = 0;
|
||||
|
@ -514,7 +512,6 @@ parseheaders(Mailbox *mb, Message *m, int addfrom, int justmime)
|
|||
}
|
||||
}
|
||||
free(s);
|
||||
/*sanembmsg(mb, m); /* fails with pop but i want this debugging for now */
|
||||
/* the blank line isn't really part of the body or header */
|
||||
if(justmime){
|
||||
m->mhend = p;
|
||||
|
@ -541,7 +538,6 @@ parseheaders(Mailbox *mb, Message *m, int addfrom, int justmime)
|
|||
* adding the unix header all the time screws up mime-attached
|
||||
* rfc822 messages.
|
||||
*/
|
||||
/*sanembmsg(mb, m); /* fails with pop but i want this debugging for now */
|
||||
if(!addfrom && !m->unixfrom)
|
||||
m->unixheader = nil;
|
||||
else if(m->unixheader == nil){
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
TARG= fs\
|
||||
|
||||
OFILES=\
|
||||
bos.$O\
|
||||
cache.$O\
|
||||
fs.$O\
|
||||
header.$O\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue