qrexec: handle vchan connect errors

This commit is contained in:
Marek Marczykowski 2013-05-04 04:18:30 +02:00 committed by Marek Marczykowski-Górecki
parent d08831cc7e
commit 43770dae36

View File

@ -205,6 +205,10 @@ void init(int xid)
} }
vchan = libvchan_client_init(xid, REXEC_PORT); vchan = libvchan_client_init(xid, REXEC_PORT);
if (!vchan) {
perror("cannot connect to qrexec agent");
exit(1);
}
/* wait for connection */ /* wait for connection */
while (!libvchan_is_open(vchan)) while (!libvchan_is_open(vchan))
libvchan_wait(vchan); libvchan_wait(vchan);