diff options
| author | Charles Forsyth <charles.forsyth@gmail.com> | 2015-04-29 15:09:58 +0100 |
|---|---|---|
| committer | Charles Forsyth <charles.forsyth@gmail.com> | 2015-04-29 15:09:58 +0100 |
| commit | 1ac9729e9325d84db36c04b5cda3b5b1bc0d041f (patch) | |
| tree | 9437907d92b84f72b1d94686396d1b068f68bb60 /appl/cmd | |
| parent | 170ff9d45744c9a94d26be32709fb3f616ba141a (diff) | |
convert to use Dial module
Diffstat (limited to 'appl/cmd')
| -rw-r--r-- | appl/cmd/dial.b | 15 |
1 files changed, 10 insertions, 5 deletions
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; |
