From 1ac9729e9325d84db36c04b5cda3b5b1bc0d041f Mon Sep 17 00:00:00 2001 From: Charles Forsyth Date: Wed, 29 Apr 2015 15:09:58 +0100 Subject: convert to use Dial module --- appl/cmd/dial.b | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'appl/cmd/dial.b') diff --git a/appl/cmd/dial.b b/appl/cmd/dial.b index c562a570..254c48e9 100644 --- a/appl/cmd/dial.b +++ b/appl/cmd/dial.b @@ -1,4 +1,4 @@ -implement Dial; +implement Dialc; include "sys.m"; sys: Sys; include "draw.m"; @@ -7,11 +7,13 @@ include "keyring.m"; keyring: Keyring; include "security.m"; auth: Auth; +include "dial.m"; + dial: Dial; include "sh.m"; sh: Sh; Context: import sh; -Dial: module { +Dialc: module { init: fn(nil: ref Draw->Context, argv: list of string); }; @@ -38,6 +40,9 @@ init(drawctxt: ref Draw->Context, argv: list of string) sh = load Sh Sh->PATH; if (sh == nil) badmodule(Sh->PATH); + dial = load Dial Dial->PATH; + if (dial == nil) + badmodule(Dial->PATH); auth->init(); alg: string; @@ -87,9 +92,9 @@ init(drawctxt: ref Draw->Context, argv: list of string) } } - (ok, c) := sys->dial(addr, nil); - if (ok == -1) { - sys->fprint(stderr(), "dial: cannot dial %s:: %r\n", addr); + c := dial->dial(addr, nil); + if (c == nil) { + sys->fprint(stderr(), "dial: cannot dial %s: %r\n", addr); raise "fail:errors"; } user: string; -- cgit v1.2.3