[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r12080 - gnunet/src/arm
From: |
gnunet |
Subject: |
[GNUnet-SVN] r12080 - gnunet/src/arm |
Date: |
Thu, 1 Jul 2010 17:51:17 +0200 |
Author: grothoff
Date: 2010-07-01 17:51:17 +0200 (Thu, 01 Jul 2010)
New Revision: 12080
Modified:
gnunet/src/arm/test_gnunet_service_manager.c
Log:
only run test if we can resolve our own hostname
Modified: gnunet/src/arm/test_gnunet_service_manager.c
===================================================================
--- gnunet/src/arm/test_gnunet_service_manager.c 2010-07-01 15:42:51 UTC
(rev 12079)
+++ gnunet/src/arm/test_gnunet_service_manager.c 2010-07-01 15:51:17 UTC
(rev 12080)
@@ -25,6 +25,7 @@
#include "platform.h"
#include "gnunet_arm_service.h"
#include "gnunet_resolver_service.h"
+#include "gnunet_os_lib.h"
#include "gnunet_program_lib.h"
/**
@@ -166,6 +167,22 @@
int
main (int argc, char *argv[])
{
+ char hostname[GNUNET_OS_get_hostname_max_length() + 1];
+
+ if (0 != gethostname (hostname, sizeof (hostname) - 1))
+ {
+ GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR |
+ GNUNET_ERROR_TYPE_BULK, "gethostname");
+ fprintf (stderr, "Failed to determine my own hostname, testcase not
run.\n");
+ return 0;
+ }
+ if (NULL == gethostbyname (hostname))
+ {
+ fprintf (stderr, "Failed to resolve my hostname `%s', testcase not
run.\n",
+ hostname);
+ return 0;
+ }
+
GNUNET_log_setup("test-gnunet-service-manager",
#if VERBOSE
"DEBUG",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r12080 - gnunet/src/arm,
gnunet <=