import of dnsmasq-2.16.tar.gz

This commit is contained in:
Simon Kelley
2004-10-21 20:24:00 +01:00
parent 36717eeefc
commit fd9fa4811d
21 changed files with 1193 additions and 635 deletions

View File

@@ -251,3 +251,20 @@ int is_same_net(struct in_addr a, struct in_addr b, struct in_addr mask)
{
return (a.s_addr & mask.s_addr) == (b.s_addr & mask.s_addr);
}
int retry_send(void)
{
struct timespec waiter;
if (errno == EAGAIN)
{
waiter.tv_sec = 0;
waiter.tv_nsec = 10000;
nanosleep(&waiter, NULL);
return 1;
}
if (errno == EINTR)
return 1;
return 0;
}