Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread Giorgos Keramidas
On Sun, 2 Jan 2011 18:46:47 -0500, Eitan Adler li...@eitanadler.com wrote: What about this patch? I incorporated your feedback so I am not going to reply inline. Since the pattern of converting strings to int-derivative values appears multiple times, I'd probably prefer something like a new

Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread Giorgos Keramidas
On Tue, 04 Jan 2011 11:36:38 +0100, Giorgos Keramidas keram...@freebsd.org wrote: On Sun, 2 Jan 2011 18:46:47 -0500, Eitan Adler li...@eitanadler.com wrote: What about this patch? I incorporated your feedback so I am not going to reply inline. Since the pattern of converting strings to

Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread Kostik Belousov
On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: On Tue, 04 Jan 2011 11:36:38 +0100, Giorgos Keramidas keram...@freebsd.org wrote: On Sun, 2 Jan 2011 18:46:47 -0500, Eitan Adler li...@eitanadler.com wrote: What about this patch? I incorporated your feedback so I am not

Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread Giorgos Keramidas
On Tue, 4 Jan 2011 13:25:02 +0200, Kostik Belousov kostik...@gmail.com wrote: On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: On Tue, 04 Jan 2011 11:36:38 +0100, Giorgos Keramidas keram...@freebsd.org wrote: Since the pattern of converting strings to int-derivative values

Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread John Baldwin
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

Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread Alexander Best
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); +} +

Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread Garrett Cooper
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);

Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread Giorgos Keramidas
On Tue, 4 Jan 2011 08:58:48 -0800, Garrett Cooper yaneg...@gmail.com wrote: + errno = 0; + res = strtol(str, endp, 10); + if (errno != 0 || endp == str || *endp != '\0') + err(1, %s shall be a number, errname); Small nit, maybe use 'must' instead of 'shall'. it seems at some

Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol

2011-01-04 Thread Garrett Cooper
On Jan 4, 2011, at 10:12 AM, Giorgos Keramidas wrote: On Tue, 4 Jan 2011 08:58:48 -0800, Garrett Cooper yaneg...@gmail.com wrote: + errno = 0; + res = strtol(str, endp, 10); + if (errno != 0 || endp == str || *endp != '\0') + err(1, %s shall be a number, errname); Small nit, maybe