From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 17:29:13 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8922A106564A for ; Tue, 4 Jan 2011 17:29:13 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 521578FC14 for ; Tue, 4 Jan 2011 17:29:13 +0000 (UTC) Received: by pzk32 with SMTP id 32so3414550pzk.13 for ; Tue, 04 Jan 2011 09:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to :x-mailer; bh=nDk5JrOTgWUdAheeIQRR4NPZ2Bw58fHW3lD3T/rWoU0=; b=OM7CXh3Ilg/uUi6zLyPvOz9VBq81lj8Jj9E1Z0fH8OkgUDfrUm/Qe/NsiTrsFsydY4 XmbCb4Ykh7OKix+RlhJrsA0Cj6TtLJ6X/aHB6ZJBUh4mWyV9aVg0V+yiPc6YAVYBy3zd F25fadp/NZ1TU7CkQifoIQLZbG5e/JiyR/D74= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=PTH0/rq95b5lxEj/rIf4wxQMU4jcebv4m1fy2ynrMehdmpDwmNHeIAe7abmeww79dC sXoc7VbJw0/zRSw7sYfa9oDq62w1J8hFuJd1LVLlpbDrgdJBFVBcpvpLUmtsEAgWxsmZ uARbUcExUYd98nTRv9kkg4WN/I/JcUHKn4Xnk= Received: by 10.142.133.4 with SMTP id g4mr7054121wfd.152.1294160334048; Tue, 04 Jan 2011 08:58:54 -0800 (PST) Received: from [192.168.20.5] (c-24-130-151-210.hsd1.ca.comcast.net [24.130.151.210]) by mx.google.com with ESMTPS id w22sm31092099wfd.7.2011.01.04.08.58.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 08:58:52 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1082) From: Garrett Cooper In-Reply-To: <20110104134940.GA8529@freebsd.org> Date: Tue, 4 Jan 2011 08:58:48 -0800 Message-Id: <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> <20110104134940.GA8529@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org, Eitan Adler , hackers@freebsd.org, Giorgos Keramidas , Kostik Belousov Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 17:29:13 -0000 On Jan 4, 2011, at 5:49 AM, Alexander Best wrote: > On Tue Jan 4 11, John Baldwin wrote: >> On Tuesday, January 04, 2011 6:25:02 am Kostik Belousov wrote: >>> On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: >>> @@ -123,12 +121,28 @@ main(argc, argv) >>> } >>> exit(0); >>> } >>> - exit (1); >>> + exit(1); >>> +} >>> + >>> +static int >>> +parseint(const char *str, const char *errname) >>> +{ >>> + char *endp; >>> + long res; >>> + >>> + errno =3D 0; >>> + res =3D strtol(str, &endp, 10); >>> + if (errno !=3D 0 || endp =3D=3D str || *endp !=3D '\0') >>> + err(1, "%s shall be a number", errname); >>=20 >> Small nit, maybe use 'must' instead of 'shall'. >=20 > it seems at some point there has been a massive usage of the term = 'shall' in > manual pages, which people tried to get rid of. hence the > 'usr/share/examples/mdoc/deshallify.sh' script. I know shall is used widely by opengroup when describing definitions and = interfaces in the POSIX standards, but the connotation in English is = very squishy, so I agree with John that must would be better. BTW, only if errno was non-zero would using err(3) be logical. Otherwise = it will just produce noise :). > maybe this should be noted in style(9)? Thanks, -Garrett=