Re: [Patch 1/1] CLD: Introduce the "New CLD" API
Jeff Garzik <[email protected]>
| Newsgroups | org.kernel.vger.hail-devel |
|---|---|
| Message-ID | <[email protected]> |
On 02/08/2010 08:46 PM, Pete Zaitcev wrote: > On Mon, 08 Feb 2010 07:32:56 -0500 > Jeff Garzik<[email protected]> wrote: > >> - log param in cldc-dns should not be made conditional as an >> undocumented side effect of ncld > > I pulled, and it appears that you merged a code that crashes at the > first error message. We need something like this: So it successfully exposed locations that failed to propagate logging support. :) > diff --git a/lib/cldc.c b/lib/cldc.c > index 7c30064..beb1e22 100644 > --- a/lib/cldc.c > +++ b/lib/cldc.c > @@ -98,6 +98,15 @@ static void cldc_errlog(int prio, const char *fmt, ...) > va_end(ap); > } > > +static void ncld_nolog(int prio, const char *fmt, ...) > +{ > + ; > +} > + > +static struct hail_log ncld_log = { > + .func = ncld_nolog > +}; > + > static int ack_seqid(struct cldc_session *sess, uint64_t seqid_le) > { > XDR xdrs; > @@ -1297,7 +1306,7 @@ static int ncld_getsrv(char **hostp, unsigned short *portp) > return errno; > hostb[hostsz-1] = 0; > > - if (cldc_getaddr(&host_list, hostb, NULL)) > + if (cldc_getaddr(&host_list, hostb,&ncld_log)) > return 1001; > Logging pointer should be supplied by the caller... that is the larger bug. Needing a no-op log function is just an indication of that. Jeff