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: Sat, 13 Feb 2010 19:52:18 -0500 Message-ID: <4B774942.9040308@garzik.org> References: <20100207121550.7ee94ff6@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=ELfq2gVTniOZAA9bFWgoSqp8YoXv3Q9pBJ13f4Jmg50=; b=DAERGQU1Zs5OdWfLaqL5bFfeO92B8PFi+5pYsAnAd805WC4iyGCJllh82kqO3FvOQy mkYKWcL8Ol1fXA0M/AXnpxojUgipY74gAp6m+bTMKbUQeaDDotiu6JKi4ilafcqoAXxi IfOnXuCPm2EFfi2SNz+/DjxiQx9W2O3iceT60= In-Reply-To: <20100207121550.7ee94ff6@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/07/2010 02:15 PM, Pete Zaitcev wrote: > + case CREQ_MKDIR: > + rc = 0; > + fhp = ncld_open(nsp, creq.path, > + COM_DIRECTORY | COM_CREATE | COM_EXCL,&error, > + 0, NULL, NULL); > + if (fhp) > + ncld_close(fhp); > + else > + rc = error; > + break; > + [...] > - } > - if (tcode != TC_OK) { > - fprintf(stderr, "thread startup failed\n"); > + nsp = ncld_sess_open(dr->host, dr->port,&error, sess_event, NULL, > + "cldcli", "cldcli"); > + if (!nsp) { > + if (error< 1000) { > + fprintf(stderr, TAG ": cannot open CLD session: %s\n", > + strerror(error)); > + } else { > + fprintf(stderr, TAG ": cannot open CLD session: %d\n", > + error); > + } > return 1; > } A point of style: the 'p' suffix is discouraged. It is too much like the much-maligned Hungarian notation, which is odious in part because it duplicates information found in the type definition. In this case, 'p' duplicates the indication that it is a pointer. The return value from ncld_sess_open() should be named 'ns' or 'sess' or similar. The return value from ncld_open() should be named 'fh' or similar. Jeff