From eb0e16d4058213ef392fdbed0ddd72a59beeefb0 Mon Sep 17 00:00:00 2001 From: Stephen Lane-Walsh Date: Thu, 16 Feb 2023 17:12:11 -0500 Subject: [PATCH] Fix: mdsconnect incorrectly aborts on the first connection Somewhere along the line TdiShrExt->rMdsConnect started returning the connection number (starting at 0) instead of a status code. On an error, it actually returns -1, not 0. If mdsconnect is called with _abort set, then it will abort() on the first connection. --- tdi/remote/MdsConnect.fun | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdi/remote/MdsConnect.fun b/tdi/remote/MdsConnect.fun index f64cd602bc..5a301e2edb 100644 --- a/tdi/remote/MdsConnect.fun +++ b/tdi/remote/MdsConnect.fun @@ -13,6 +13,6 @@ call: _host = Host name eg elpp1.epfl.ch or elpp1.epfl.ch:9000 write(*,"Host taken from MDS_HOST ["//_host//"]"); } _status = TdiShrExt->rMdsConnect(ref(_host//char(0))); - if (present(_abort) && _status == 0) abort(); + if (present(_abort) && _status == -1) abort(); return(_status); }