[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: tolerate failure to start g
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: tolerate failure to start gnunet-service-resolver, make resolver not crash if /etc/resolv.conf does not exist |
Date: |
Wed, 15 Aug 2018 22:57:38 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new b727497bd tolerate failure to start gnunet-service-resolver, make
resolver not crash if /etc/resolv.conf does not exist
b727497bd is described below
commit b727497bdeb0487328d470db23ea8cd6e8fdd809
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Aug 15 22:57:31 2018 +0200
tolerate failure to start gnunet-service-resolver, make resolver not crash
if /etc/resolv.conf does not exist
---
src/util/gnunet-service-resolver.c | 2 ++
src/util/test_os_start_process.c | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/util/gnunet-service-resolver.c
b/src/util/gnunet-service-resolver.c
index e9397e085..90ed746b6 100644
--- a/src/util/gnunet-service-resolver.c
+++ b/src/util/gnunet-service-resolver.c
@@ -1077,11 +1077,13 @@ init_cb (void *cls,
GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
cls);
dnsstub_ctx = GNUNET_DNSSTUB_start (128);
+ dns_servers = NULL;
num_dns_servers = lookup_dns_servers (&dns_servers);
if (0 >= num_dns_servers)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("No DNS server available. DNS resolution will not be
possible.\n"));
+ return;
}
for (int i = 0; i < num_dns_servers; i++)
{
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index cfc39e1e0..1d87f2ab3 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -11,7 +11,7 @@
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -217,6 +217,12 @@ check_kill ()
fn,
"gnunet-service-resolver", "-",
NULL);
+ if (NULL == proc)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to launch gnunet-service-resolver. Is your system
setup correct?\n");
+ return 77;
+ }
sleep (1); /* give process time to start, so we actually use the pipe-kill
mechanism! */
GNUNET_free (fn);
if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG))
@@ -250,7 +256,14 @@ check_instant_kill ()
hello_pipe_stdin, hello_pipe_stdout, NULL,
fn,
"gnunet-service-resolver", "-", NULL);
- if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG))
+ if (NULL == proc)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to launch gnunet-service-resolver. Is your system
setup correct?\n");
+ return 77;
+ }
+ if (0 != GNUNET_OS_process_kill (proc,
+ GNUNET_TERM_SIG))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
}
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: tolerate failure to start gnunet-service-resolver, make resolver not crash if /etc/resolv.conf does not exist,
gnunet <=