From owner-cvs-all Sun Jan 14 4:37:43 2001 Delivered-To: cvs-all@freebsd.org Received: from ringworld.nanolink.com (gb.office1.bg [193.68.11.173]) by hub.freebsd.org (Postfix) with SMTP id 058DF37B402 for ; Sun, 14 Jan 2001 04:37:04 -0800 (PST) Received: (qmail 4105 invoked by uid 1000); 14 Jan 2001 12:35:44 -0000 Date: Sun, 14 Jan 2001 14:35:44 +0200 From: Peter Pentchev To: Alfred Perlstein Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/mkdir mkdir.c Message-ID: <20010114143544.F1598@ringworld.oblivion.bg> Mail-Followup-To: Alfred Perlstein , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org References: <200101141208.f0EC8pk52510@freefall.freebsd.org> <20010114141633.D1598@ringworld.oblivion.bg> <20010114043149.P7240@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010114043149.P7240@fw.wintelcom.net>; from alfred@FreeBSD.org on Sun, Jan 14, 2001 at 04:31:49AM -0800 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Jan 14, 2001 at 04:31:49AM -0800, Alfred Perlstein wrote: > * Peter Pentchev [010114 04:18] wrote: > > On Sun, Jan 14, 2001 at 04:08:51AM -0800, Alfred Perlstein wrote: > > > alfred 2001/01/14 04:08:51 PST > > > > > > Modified files: > > > bin/mkdir mkdir.c > > > Log: > > > Special case the error reporting when errno is ENOTDIR or ENOENT. > > > > > > This makes "mkdir /nonexistant/foo" complain that /nonexistant > > > doesn't exist rather than /nonexistant/foo which doesn't make much > > > sense. > > > > > > Submitted (in a different form) by: W.H.Scholten > > > > > > Revision Changes Path > > > 1.20 +6 -2 src/bin/mkdir/mkdir.c > > > > How about the attached program implementing and demonstrating a new > > direxname() function, which uses dirname()'s static buffer to extract > > the longest existing path component of the specified dirname? > > mkdir(1) could report this in case of error (something like > > "cannot create /path/exists/nonex/foo/bar, nonexisting path components > > after /path/exists" > > I like this, you just have to be careful not to spam over errno with your > stat(2) results. If you have the time I'd apply it to mkdir, I'm not > 'MAINTAINER', so have at it. :) If we get to the stat(2) call, this means dirname() has returned a non-NULL pointer to its path buffer, and errno is irrelevant. As to applying, for the present I'd prefer to just propose patches; I do not think Core has approved me for committing to the source tree (nor do I really strive for that :) G'luck, Peter -- What would this sentence be like if pi were 3? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message