From 540bf4a5c42f3e757fe53185cf5553ef35dbf45b Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Mon, 13 Apr 2015 00:45:15 -0400 Subject: [PATCH] not clear which error message is given for ipv6 failure --- src/toxic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/toxic.c b/src/toxic.c index ba52981..347ce49 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -689,14 +689,13 @@ static Tox *load_toxic(char *data_path) TOX_ERR_NEW new_err; Tox *m = load_tox(data_path, &tox_opts, &new_err); - if (new_err == TOX_ERR_NEW_PORT_ALLOC && tox_opts.ipv6_enabled) { + if (new_err != TOX_ERR_NEW_OK && tox_opts.ipv6_enabled) { queue_init_message("Falling back to ipv4"); tox_opts.ipv6_enabled = false; m = load_tox(data_path, &tox_opts, &new_err); - } - - if (m == NULL || new_err != TOX_ERR_NEW_OK) + } else if (new_err != TOX_ERR_NEW_OK) { exit_toxic_err("Tox network failed to initialize (tox_new failed with error %d)", new_err); + } init_tox_callbacks(m); load_friendlist(m);