[Babel-users] time, syscall, etc.

Matthieu Boutier matthieu.boutier at wanadoo.fr
Fri Jul 15 17:55:55 UTC 2011


	Hello,

> Yeah, I could write more legible comments ;-)
In a first time, just begin with "more comments" !! ;-)

util.c, timeval_min, ~110:
I was happy: there is a comment: 
but it seems that {0, x} represents infinity, and not {0, 0}, or I think:
	if(s->tv_sec == 0)
should be
	if(s->tv_sec == 0 && s->tv_usec == 0)
no ?


babel.c, main loop, around 550:
if(kernel_socket < 0) kernel_setup_socket(1);
Previously, we consider that a bad kernel_socket was sufficient to stop the program. Hum, I don't think the socket is possibly <0 at this point.
Same remark for the local_socket and local_server_socket.

Is FD_ZERO a non-raming* syscall?

It seems necessary to do a gettime(&now); only after select (in the other case we don't have wait anything). So I think it's better to put gettime in the "if" statement. If you think that checking for the next timeout may take a consequent time, so put the first "gettime" just before the "if".


babel.c, somewhere near 590-610:
if(errno != EAGAIN && errno != EINTR) {
    perror("recv");
    sleep(1);
}
Euhm… why blocking the entire rest of the program just because of a EAGAIN ? Don't we would sleep (if necessary) at the "select" ?


And finaly, what is the "*unicast*" things (like "unicast_neighbour", "flush_unicast") ?

Thanks!

Matthieu


* qui ne rame pas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/babel-users/attachments/20110715/6593c04c/attachment-0001.html>


More information about the Babel-users mailing list