From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pete Zaitcev Subject: Re: [Patch 1/1] CLD: Introduce the "New CLD" API Date: Mon, 8 Feb 2010 18:46:49 -0700 Message-ID: <20100208184649.51374774@redhat.com> References: <20100207121550.7ee94ff6@redhat.com> <4B700478.3020305@garzik.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4B700478.3020305@garzik.org> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Jeff Garzik Cc: Project Hail List 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: 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; /* @@ -1490,7 +1499,7 @@ static struct cldc_ops ncld_ops = { .timer_ctl = ncld_p_timer_ctl, .pkt_send = ncld_p_pkt_send, .event = ncld_p_event, - .errlog = NULL, + .errlog = ncld_nolog, }; static int ncld_new_sess(struct cldc_call_opts *copts, enum cle_err_codes errc) Stubbing of ncld_ops is not related to the crash, but just for consistency. -- Pete