summaryrefslogtreecommitdiff
path: root/minecctl/misc.c
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-27 15:18:45 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-27 15:18:45 +0200
commit99b2c70137fef05a5a18f439b9010ddba455f5cb (patch)
treeb0c08cfce14019cd634e6b4b84d0cf0f6e8eee6a /minecctl/misc.c
parenta87e894ba3f3a8915389f651fb034f0d1835630c (diff)
Create a shared mc protocol implementation and use it in the proxy and cmd line tool
Diffstat (limited to 'minecctl/misc.c')
-rw-r--r--minecctl/misc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/minecctl/misc.c b/minecctl/misc.c
index bb33161..72eb03c 100644
--- a/minecctl/misc.c
+++ b/minecctl/misc.c
@@ -68,8 +68,13 @@ connect_any(struct list_head *addrs, bool may_fail)
bool connected = false;
int sfd;
- if (list_empty(addrs))
- die("No address to connect to");
+ /* FIXME: check callers and coordinate debug msg */
+ if (list_empty(addrs)) {
+ if (may_fail)
+ return -1;
+ else
+ die("No address to connect to");
+ }
list_for_each_entry(saddr, addrs, list) {
verbose("Attempting connection to %s", saddr->addrstr);