X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=mutt_tunnel.c;h=db5f50eab8e8bd064af26a22bf173d4b1b3c4d72;hb=e01486aabea6f0af36933158bd58b9ab03b30add;hp=6cc092dc851f7f7bf804d2a335df11ad169e5ca2;hpb=7480539010bab6905c944b11b036492a1a625994;p=apps%2Fmadmutt.git diff --git a/mutt_tunnel.c b/mutt_tunnel.c index 6cc092d..db5f50e 100644 --- a/mutt_tunnel.c +++ b/mutt_tunnel.c @@ -1,7 +1,7 @@ /* * Copyright notice from original mutt: * Copyright (C) 2000 Manoj Kasichainula - * Copyright (C) 2001 Brendan Cully + * Copyright (C) 2001,2005 Brendan Cully * * This file is part of mutt-ng, see http://www.muttng.org/. * It's licensed under the GNU General Public License, @@ -118,12 +118,18 @@ static int tunnel_socket_open (CONNECTION * conn) static int tunnel_socket_close (CONNECTION * conn) { TUNNEL_DATA *tunnel = (TUNNEL_DATA *) conn->sockdata; + int status; close (tunnel->readfd); close (tunnel->writefd); - waitpid (tunnel->pid, NULL, 0); + 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); + } FREE (&conn->sockdata); - return 0; }