#define LOG(kind,...) GNUNET_log_from (kind, "resolver-api", __VA_ARGS__)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "resolver-api", syscall)
+
/**
* Maximum supported length for a hostname
*/
inet_ntop (AF_INET, &((struct sockaddr_in *) sa)->sin_addr, inet4,
INET_ADDRSTRLEN))
{
- GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "resolver-api",
- "inet_ntop");
+ LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "inet_ntop");
return NULL;
}
ret = GNUNET_strdup (inet4);
inet_ntop (AF_INET6, &((struct sockaddr_in6 *) sa)->sin6_addr, inet6,
INET6_ADDRSTRLEN))
{
- GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "resolver-api",
- "inet_ntop");
+ LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "inet_ntop");
return NULL;
}
ret = GNUNET_strdup (inet6);
if (0 != gethostname (hostname, sizeof (hostname) - 1))
{
- GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
- "resolver-api", "gethostname");
+ LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+ "gethostname");
return NULL;
}
#if DEBUG_RESOLVER
if (0 != gethostname (hostname, sizeof (hostname) - 1))
{
- GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
- "resolver-api", "gethostname");
+ LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+ "gethostname");
return NULL;
}
#if DEBUG_RESOLVER