Dave,
Thanks for the review. I appreciate it.
John
On 01/14/11 01:45 PM, Dave Miner wrote:
The new version file needs comments that explain it a bit.
Will add some verbage.
installadm_util.c
191: Somewhat a nit, but a predicate function such as
check_port_in_use() would be more usually named like is_port_in_use()
Right. This code was removed in round 1 of the review and simply
re-introduced into the source in round 4 as we are now dealing
appropriately with old ISOs. Changed it to is_port_in_use().
232: one edge case here is that, were the port passed in equal to zero
and the service port had a value that strtol() couldn't convert, you'd
end up saying 0 is in use because 0 + setting EINVAL is how strtol
handles error cases.
Added the following:
#include <sys/errno.h>
....
errno = 0;
service_port = strtol(str, (char **)NULL, 10);
if (errno != 0) {
ai_free_pg_list(pgs);
return (B_FALSE);
}
which matches what the man page suggestion:
Because 0, LONG_MIN, LONG_MAX, LLONG_MIN, and LLONG_MAX are
returned on error and are also valid returns on success, an
application wishing to check for error situations should set
errno to 0, call the function, then check errno and if it is
non-zero, assume an error has occurred.
Long standing potential issue.
Dave
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss