From e2a18bd0eda077f0920274fd114240bc786f03b1 Mon Sep 17 00:00:00 2001 From: mdw Date: Sat, 17 Jun 2000 10:38:35 +0000 Subject: [PATCH] Track changes to selbuf interface. --- bres.c | 25 ++++++++++++++----------- ident.c | 9 ++++++--- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/bres.c b/bres.c index 99bf051..4971153 100644 --- a/bres.c +++ b/bres.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: bres.c,v 1.2 1999/10/30 11:28:39 mdw Exp $ + * $Id: bres.c,v 1.3 2000/06/17 10:38:35 mdw Exp $ * * Background reverse name resolution * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: bres.c,v $ + * Revision 1.3 2000/06/17 10:38:35 mdw + * Track changes to selbuf interface. + * * Revision 1.2 1999/10/30 11:28:39 mdw * Fix include error, pointed out by Chris Rutter. * @@ -316,15 +319,15 @@ static struct hostent *gethost(int fd) h->h_name = a; PUT(name); - free(name); + xfree(name); h->h_aliases = p; for (i = 0; i < hsk.nalias; i++) { *p++ = a; PUT(alias[i]); - free(alias[i]); + xfree(alias[i]); } *p++ = 0; - free(alias); + xfree(alias); #undef PUT } @@ -337,11 +340,11 @@ tidy_2: { int i; for (i = 0; i < hsk.nalias && alias[i]; i++) - free(alias[i]); - free(alias); + xfree(alias[i]); + xfree(alias); } tidy_1: - free(name); + xfree(name); tidy_0: return (0); } @@ -596,7 +599,7 @@ static void zap(bres_server *rs) void bres_abort(bres_client *rc) { if (rc->q == BRES_BYNAME) - free(rc->u.name); + xfree(rc->u.name); if (rc->rs) { sel_rmfile(&rc->rs->f); zap(rc->rs); @@ -663,10 +666,10 @@ static void answer(int fd, unsigned mode, void *vp) if (rc) { rc->func(h, rc->p); if (rc->q == BRES_BYNAME) - free(rc->u.name); + xfree(rc->u.name); } if (h) - free(h); + xfree(h); if (fail) zap(rs); if (!rc) @@ -854,7 +857,7 @@ again: lost: rc->func(0, rc->p); if (rc->q == BRES_BYNAME) - free(rc->u.name); + xfree(rc->u.name); } /* --- @resolve@ --- * diff --git a/ident.c b/ident.c index 342dc81..6d29f90 100644 --- a/ident.c +++ b/ident.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: ident.c,v 1.1 1999/10/04 21:41:58 mdw Exp $ + * $Id: ident.c,v 1.2 2000/06/17 10:38:35 mdw Exp $ * * Nonblocking RFC931 client * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: ident.c,v $ + * Revision 1.2 2000/06/17 10:38:35 mdw + * Track changes to selbuf interface. + * * Revision 1.1 1999/10/04 21:41:58 mdw * Added ident client from `fw'. * @@ -168,7 +171,6 @@ static void line(char *s, void *p) ident_request *rq = p; rq->state = IDENT_DONE; - selbuf_disable(&rq->b); close(rq->b.reader.fd); if (!s) rq->func(0, rq->p); @@ -177,6 +179,7 @@ static void line(char *s, void *p) parse(s, &i); rq->func(&i, rq->p); } + selbuf_destroy(&rq->b); } /* --- @connected@ --- * @@ -247,8 +250,8 @@ void ident_abort(ident_request *rq) conn_kill(&rq->c); break; case IDENT_READ: - selbuf_disable(&rq->b); close(rq->b.reader.fd); + selbuf_destroy(&rq->b); break; } } -- 2.11.0