On 06/28/2011 08:33 AM, Jan Friesse wrote: > Coverity doesn't complain even with testing to -1, so better patch included. > > Regards, > Honza > > Jan Friesse wrote: >> Steven Dake wrote: >>> On 06/01/2011 09:14 AM, Jan Friesse wrote: >>>> Signed-off-by: Jan Friesse <[email protected]> > >> .... > >>> Prefer a direct comparison for the error condition ie: >>> if (page_size == -1) { >>> } >>> RETURN VALUE >>> If name is invalid, -1 is returned, and errno is set to EINVAL. >>> Other‐ >>> wise, the value returned is the value of the system resource and >>> errno >>> is not changed. In the case of options, a positive value is >>> returned >>> if a queried option is available, and -1 if it is not. In the >>> case of >>> limits, -1 means that there is no definite limit. >>> >>> >> >> Main problem is not -1 but fact, that malloc takes unsigned and sysconf >> return signed. According to man page: >> >> PAGESIZE - _SC_PAGESIZE >> Size of a page in bytes. Must not be less than 1. (Some >> systems use PAGE_SIZE instead.) >> >> So I can imagine test for < 1, but patch seem to me makes much more >> sense with < 0. >> _______________________________________________ >> Openais mailing list >> [email protected] >> https://lists.linux-foundation.org/mailman/listinfo/openais >
doesn't logsys do a pagesize determination? If so that needs fixing as well. Otherweise Reviewed-by: Steven Dake <[email protected]> _______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
