~kris/9p

9hist

8d56d8a01106a05f1530797fef6a907dc41e3fc4 — David du Colombier 26 years ago 0eda2a9
Plan 9 from Bell Labs 2000-04-25
2 files changed, 19 insertions(+), 4 deletions(-)

M port/debugalloc.c
M port/devsdp.c
M port/debugalloc.c => port/debugalloc.c +10 -0
@@ 12,6 12,16 @@
#define prev	u.s.bhv
#define parent	u.s.bhp

typedef struct Bhdr	Bhdr;

struct Bhdr {
	ulong	magic;
	ulong	size;
};
enum {
	NOT_MAGIC = 0xdeadfa11,
};

struct Pool
{
	char*	name;

M port/devsdp.c => port/devsdp.c +9 -4
@@ 955,7 955,7 @@ static void
convsetstate(Conv *c, int state)
{

if(0)print("convsetstate %s -> %s\n", convstatename[c->state], convstatename[state]);
if(1)print("convsetstate %d: %s -> %s\n", c->id, convstatename[c->state], convstatename[state]);

	switch(state) {
	default:


@@ 1017,12 1017,13 @@ static void
convderef(Conv *c)
{
	c->ref--;
	if(c->ref > 0)
	if(c->ref > 0) {
		return;
	}
	assert(c->ref == 0);
	assert(c->dataopen == 0);
	assert(c->controlopen == 0);
//print("convderef: %d: ref == 0!\n", c->id);
if(0)print("convderef: %d: ref == 0!\n", c->id);
	c->state = CFree;
	if(c->chan) {	
		cclose(c->chan);


@@ 1070,7 1071,7 @@ convopenchan(Conv *c, char *path)
	if(c->state != CInit || c->chan != nil)
		error("already connected");
	c->chan = namec(path, Aopen, ORDWR, 0);
	c->channame = malloc(strlen(path)+1);
	c->channame = smalloc(strlen(path)+1);
	strcpy(c->channame, path);
	if(waserror()) {
		cclose(c->chan);


@@ 2300,8 2301,12 @@ thwackcompinit(Conv *c)
	compfree(c);

	c->in.compstate = malloc(sizeof(Unthwack));
	if(c->in.compstate == nil)
		error(Enomem);
	unthwackinit(c->in.compstate);
	c->out.compstate = malloc(sizeof(Thwack));
	if(c->out.compstate == nil)
		error(Enomem);
	thwackinit(c->out.compstate);
	c->in.comp = thwackuncomp;
	c->out.comp = thwackcomp;