don't bypass GNUnet IO
[oweals/gnunet.git] / src / util / test_resolver_api.c
index 8b3f9c4bf97948bbae890b8f44e33e22b50ae19a..af8ecdeec89c496acb459fd36b90654a626860b9 100644 (file)
@@ -235,7 +235,6 @@ run(void *cls, struct GNUNET_SCHEDULER_Handle *sched, char * const *args,
   /*
    * Looking up our own hostname
    */
-  own_hostname = GNUNET_malloc(GNUNET_OS_get_hostname_max_length() + 1);
   own_hostname = GNUNET_RESOLVER_local_hostname_get();
   check_local_hostname( NULL, own_hostname);
   GNUNET_free (own_hostname);
@@ -334,8 +333,11 @@ run(void *cls, struct GNUNET_SCHEDULER_Handle *sched, char * const *args,
 
   memset(&sa, 0, sizeof(sa));
   sa.sin_family = AF_INET;
+#ifndef MINGW
   inet_aton(ROOTSERVER_IP, &sa.sin_addr);
-
+#else
+  sa.sin_addr.S_un.S_addr = inet_addr(ROOTSERVER_IP);
+#endif
   GNUNET_RESOLVER_hostname_get(sched, cfg, (const struct sockaddr *) &sa,
       sizeof(struct sockaddr), GNUNET_YES, timeout, &check_rootserver_name, cls);
 }