- char *realhost;
-
- inst->back->init((void *)inst->term, &inst->backhandle, &inst->cfg,
- inst->cfg.host, inst->cfg.port, &realhost,
- inst->cfg.tcp_nodelay);
+ char *realhost, *error;
+
+ error = inst->back->init((void *)inst->term, &inst->backhandle,
+ &inst->cfg, inst->cfg.host, inst->cfg.port,
+ &realhost, inst->cfg.tcp_nodelay);
+
+ if (error) {
+ char *msg = dupprintf("Unable to open connection to %s:\n%s",
+ inst->cfg.host, error);
+ inst->exited = TRUE;
+ fatal_message_box(inst->window, msg);
+ sfree(msg);
+ return 0;
+ }