freebsd-hackers mailing list

FromSubjectDatesort icon
Giorgos Keramidas
Re: [patch] have rtprio check that arguments are numeric ...
Since the pattern of converting strings to int-derivative values appears multiple times, I'd probably prefer something like a new function that does the parsing *and* error-checking, to avoid duplication of errno checks, invalidchar checks, and so on, e.g. something like this near the top of rtprio.c: #include <errno.h> #include <limits.h> #include <string.h> /* * Parse an integer from 'string' into 'value'. Return the first * invalid ...
Jan 4, 3:36 am 2011
Giorgos Keramidas
Re: [patch] have rtprio check that arguments are numeric ...
instead of `return (int)x' the last bits should be slightly different, of course: if (value != NULL) *value = (int)x; return 0; } _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Jan 4, 3:40 am 2011
Kostik Belousov
Re: [patch] have rtprio check that arguments are numeric ...
Well, I think it shall be simplified. What about this ? diff --git a/usr.sbin/rtprio/rtprio.c b/usr.sbin/rtprio/rtprio.c index 245f714..fc212b5 100644 --- a/usr.sbin/rtprio/rtprio.c +++ b/usr.sbin/rtprio/rtprio.c @@ -37,31 +37,31 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/rtprio.h> -#include <sys/errno.h> #include <ctype.h> #include <err.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -static ...
Jan 4, 4:25 am 2011
Giorgos Keramidas Jan 4, 5:26 am 2011
John Baldwin
Re: [patch] have rtprio check that arguments are numeric ...
Small nit, maybe use 'must' instead of 'shall'. -- John Baldwin _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Jan 4, 6:05 am 2011
Alexander Best
Re: [patch] have rtprio check that arguments are numeric ...
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. maybe this should be noted in style(9)? cheers. -- a13x _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Jan 4, 6:49 am 2011
Garrett Cooper
Re: [patch] have rtprio check that arguments are numeric ...
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. Thanks, -Garrett_______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Jan 4, 9:58 am 2011
Giorgos Keramidas
Re: [patch] have rtprio check that arguments are numeric ...
That's a good point. I think we should change err() to errx() there. _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Jan 4, 11:12 am 2011
Garrett Cooper
Re: [patch] have rtprio check that arguments are numeric ...
kib was quick and already did it in r216967. Cheers! -Garrett_______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Jan 4, 11:19 am 2011
previous daytodaynext day
January 3, 2011January 4, 2011None