Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jan 2011 10:19:09 -0800
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Giorgos Keramidas <keramida@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, Eitan Adler <lists@eitanadler.com>, hackers@freebsd.org, Kostik Belousov <kostikbel@gmail.com>, Alexander Best <arundel@freebsd.org>
Subject:   Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol
Message-ID:  <BD75609B-549F-473D-91E6-007AE9D74354@gmail.com>
In-Reply-To: <xeiay670zgfa.fsf@kobe.laptop>
References:  <AANLkTimiJPiHBSw5i5TVJYfh9uGOyrNJx%2BoUPeB%2Bt%2BY_@mail.gmail.com> <xeia7heluf2q.fsf@kobe.laptop> <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> <20110104134940.GA8529@freebsd.org> <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> <xeiay670zgfa.fsf@kobe.laptop>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 4, 2011, at 10:12 AM, Giorgos Keramidas wrote:

> On Tue, 4 Jan 2011 08:58:48 -0800, Garrett Cooper <yanegomi@gmail.com> =
wrote:
>>>>> +	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.
>>=20
>> 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.
>>=20
>> BTW, only if errno was non-zero would using err(3) be
>> logical. Otherwise it will just produce noise :).
>=20
> That's a good point.  I think we should change err() to errx() there.

	kib was quick and already did it in r216967.
Cheers!
-Garrett=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BD75609B-549F-473D-91E6-007AE9D74354>