Skip to content

Commit

Permalink
git-imap-send: simplify tunnel construction
Browse files Browse the repository at this point in the history
Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Bernhard Reiter authored and Junio C Hamano committed Aug 18, 2014
1 parent 6c4ab27 commit f9dc5d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,17 +961,16 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc)
/* open connection to IMAP server */

if (srvc->tunnel) {
const char *argv[] = { srvc->tunnel, NULL };
struct child_process tunnel = {NULL};

imap_info("Starting tunnel '%s'... ", srvc->tunnel);

tunnel.argv = argv;
argv_array_push(&tunnel.args, srvc->tunnel);
tunnel.use_shell = 1;
tunnel.in = -1;
tunnel.out = -1;
if (start_command(&tunnel))
die("cannot start proxy %s", argv[0]);
die("cannot start proxy %s", srvc->tunnel);

imap->buf.sock.fd[0] = tunnel.out;
imap->buf.sock.fd[1] = tunnel.in;
Expand Down

0 comments on commit f9dc5d6

Please sign in to comment.