From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [Patch 1/1] CLD: Introduce the "New CLD" API Date: Mon, 08 Feb 2010 21:06:17 -0500 Message-ID: <4B70C319.6040005@garzik.org> References: <20100207121550.7ee94ff6@redhat.com> <4B700478.3020305@garzik.org> <20100208184649.51374774@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=dd8nIvB9gZdrABaYjP9EanaftXe3/FuI8k6Nql2AKug=; b=vCYidRaQIbTlVCVp+FCWc+VDUScy2h8P8rARArHVi4p2Ibac3buGQdmv1xHx6Z+n34 aXwirtL/gsEir8M+tUa16RuvoOlMzKhD410YrHOLSLjQfazyW53c8vqLf60/zLFk2bRu 6Tzg0BrUJmZTwQMLC1Fp7I8GBfyOiHGZYWt1Y= In-Reply-To: <20100208184649.51374774@redhat.com> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Pete Zaitcev Cc: Project Hail List On 02/08/2010 08:46 PM, Pete Zaitcev wrote: > On Mon, 08 Feb 2010 07:32:56 -0500 > Jeff Garzik 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