From: Daniel Lenski Date: Sun, 17 May 2020 00:09:24 +0000 (-0700) Subject: we should still try to cleanly close the session if tun device creation fails X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=73b4a4fa5289b0e3cc81bbfeffbe9177d0bcbcc9;p=users%2Fdwmw2%2Fopenconnect.git we should still try to cleanly close the session if tun device creation fails Signed-off-by: Daniel Lenski --- diff --git a/main.c b/main.c index cc3dd91e..682afacf 100644 --- a/main.c +++ b/main.c @@ -2014,6 +2014,10 @@ int main(int argc, char **argv) vpn_progress(vpninfo, PRG_INFO, _("User detached from session (SIGHUP); exiting.\n")); ret = 0; break; + case -EIO: + vpn_progress(vpninfo, PRG_INFO, _("Unrecoverable I/O error; exiting.\n")); + ret = 0; + break; default: vpn_progress(vpninfo, PRG_ERR, _("Unknown error; exiting.\n")); ret = 1; diff --git a/mainloop.c b/mainloop.c index 79864743..f78c0c2a 100644 --- a/mainloop.c +++ b/mainloop.c @@ -132,6 +132,8 @@ static int setup_tun_device(struct openconnect_info *vpninfo) ret = openconnect_setup_tun_device(vpninfo, vpninfo->vpnc_script, vpninfo->ifname); if (ret) { fprintf(stderr, _("Set up tun device failed\n")); + if (!vpninfo->quit_reason) + vpninfo->quit_reason = "Set up tun device failed"; return ret; }