- waitpid (tunnel->pid, NULL, 0);
- FREE (&conn->sockdata);
-
+ waitpid (tunnel->pid, &status, 0);
+ if (!WIFEXITED(status) || WEXITSTATUS(status)) {
+ mutt_error(_("Tunnel to %s returned error %d (%s)"),
+ conn->account.host, WEXITSTATUS(status),
+ NONULL(mutt_strsysexit(WEXITSTATUS(status))));
+ mutt_sleep (2);
+ }
+ mem_free (&conn->sockdata);