From owner-freebsd-arch@FreeBSD.ORG Mon Aug 23 21:22:41 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B70C916A4CE; Mon, 23 Aug 2004 21:22:41 +0000 (GMT) Received: from blake.polstra.com (blake.polstra.com [64.81.189.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F08743D1D; Mon, 23 Aug 2004 21:22:41 +0000 (GMT) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (dsl081-189-067.sea1.dsl.speakeasy.net [64.81.189.67]) by blake.polstra.com (8.12.11/8.12.11) with ESMTP id i7NLMbYv044498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Aug 2004 14:22:37 -0700 (PDT) (envelope-from jdp@strings.polstra.com) Received: (from jdp@localhost) by strings.polstra.com (8.12.11/8.12.11/Submit) id i7NLMbda029464; Mon, 23 Aug 2004 14:22:37 -0700 (PDT) (envelope-from jdp) Message-ID: X-Mailer: XFMail 1.5.5 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200408231141.25077.jhb@FreeBSD.org> Date: Mon, 23 Aug 2004 14:22:37 -0700 (PDT) From: John Polstra To: John Baldwin X-Bogosity: No, tests=bogofilter, spamicity=0.078671, version=0.14.5 cc: Giorgos Keramidas cc: freebsd-arch@freebsd.org Subject: Re: Introducing a poweroff(8) command X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2004 21:22:41 -0000 On 23-Aug-2004 John Baldwin wrote: > On Saturday 21 August 2004 04:22 pm, Giorgos Keramidas wrote: >> Add a hard link to reboot(8) called "poweroff" which defaults to the >> same behavior as "halt -p". Also fix a related bug while here. When >> called as "halt -p" the previous reboot program would not disallow the >> use of -d for saving kernel dumps (it would inhibit dumps without the >> -p option though). >> >> Index: Makefile [...] > I think this is buggy in that p will point to the / character since you don't > modify it in the second case. I.e. what you wrote is basically this: > > p = rindex(*argv, '/'); > if (p != NULL) > p + 1; /* does nothing */ > else > *argv; /* also does nothing */ [...] This whole thread seems ridiculous to me. Why can't it be done with a simple shell script? John