static void
check_hostname (void *cls, const struct sockaddr *sa, socklen_t salen)
{
- char buf[INET6_ADDRSTRLEN];
int *ok = cls;
if (salen == 0)
(*ok) &= ~8;
return;
}
- if (salen == sizeof (struct sockaddr_in))
- {
- struct sockaddr_in *in = (struct sockaddr_in *) sa;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Got IP address `%s' for our host.\n"),
- inet_ntop (AF_INET, &in->sin_addr, buf, sizeof (buf)));
- }
- else if (salen == sizeof (struct sockaddr_in6))
- {
- struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) sa;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Got IP address `%s' for our host.\n"),
- inet_ntop (AF_INET6, &in6->sin6_addr, buf, sizeof (buf)));
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Got address of bogus length %u\n"), salen);
- GNUNET_assert (0);
- }
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Got IP address `%s' for our host.\n"),
+ GNUNET_a2s (sa, salen));
}
run (void *cls,
struct GNUNET_SCHEDULER_Handle *sched,
char *const *args,
- const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+ const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct sockaddr_in sa;
struct GNUNET_TIME_Relative timeout =
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
ok = 1;
}
- waitpid (pid, NULL, 0);
+ GNUNET_OS_process_wait(pid);
if (ok != 0)
fprintf (stderr, "Missed some resolutions: %u\n", ok);
return ok;