From owner-cvs-all Tue Aug 31 12:38:39 1999 Delivered-To: cvs-all@freebsd.org Received: from ns.skylink.it (ns.skylink.it [194.177.113.1]) by hub.freebsd.org (Postfix) with ESMTP id 58EF115A63; Tue, 31 Aug 1999 12:38:17 -0700 (PDT) (envelope-from hibma@skylink.it) Received: from heidi.plazza.it (va-167.skylink.it [194.185.55.167]) by ns.skylink.it (8.9.1/8.8.8) with ESMTP id VAA02198; Tue, 31 Aug 1999 21:38:23 +0200 Received: from localhost (localhost [127.0.0.1]) by heidi.plazza.it (8.9.3/8.8.5) with ESMTP id TAA07132; Tue, 31 Aug 1999 19:08:50 GMT X-No-Spam: Neither the receipients nor the senders email address(s) are to be used for Unsolicited (Commercial) Email without the explicit written consent of either party; as a per-message fee is incurred for inbound and outbound traffic to the originator. Posted-Date: Tue, 31 Aug 1999 19:08:50 GMT Date: Tue, 31 Aug 1999 21:08:50 +0200 (CEST) From: Nick Hibma X-Sender: n_hibma@heidi.plazza.it Reply-To: Nick Hibma To: "Jeffrey J. Mountin" Cc: John Hay , obrien@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/rm rm.1 rm.c In-Reply-To: <3.0.3.32.19990831132028.0155c100@207.227.119.2> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > > case FTS_DNR: > >- if ((e=rmdir(p->fts_accpath)) || (fflag && errno == ENOENT)) { > >+ if (!(e=rmdir(p->fts_accpath)) || (fflag && errno == ENOENT)) { > > if (e == 0 && vflag) > > (void)printf("%s\n", p->fts_accpath); > > continue; > > I'm a neophyte to C, but surely anyone can miss the '!' when doing a quick > review of code they are not initimate with. Certainly seen enough code to > shudder at some practices, alibeit they are mostly located in the ports > collection. Regardless it's not for me to judge, only suggest. > > Now, is the 'e=' supposed to be 'e=='? > > Must be -current code, so there might be a reason. I'd like to add that e = rmdir(p->fts_accpath); if ( !e || (fflag && errno == ENOENT)) { is equivalent to if (!(e=rmdir(p->fts_accpath)) || (fflag && errno == ENOENT)) { but does not hide the fact that the rmdir is executed in all cases. Just my 15 Lire worth of comments. Nick -- e-Mail: hibma@skylink.it To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message