From a6011949be081a8fe1bec0713ce60c36beb3a351 Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Sat, 14 Jul 2007 10:41:18 +0000 Subject: 20070714-1142 --- appl/cmd/9export.b | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'appl/cmd/9export.b') diff --git a/appl/cmd/9export.b b/appl/cmd/9export.b index 1c430d88..83a2ddb4 100644 --- a/appl/cmd/9export.b +++ b/appl/cmd/9export.b @@ -124,7 +124,7 @@ init(nil: ref Draw->Context, args: list of string) key[12:] = secret[0:ns]; if(sys->write(fd, key[12:], 4) != 4) fail("import", sys->sprint("can't write key to remote: %r")); - if(readn(fd, key, 4) != 4) + if(sys->readn(fd, key, 4) != 4) fail("import", sys->sprint("can't read remote key: %r")); digest := array[Keyring->SHA1dlen] of byte; kr->sha1(key, len key, digest, nil); @@ -137,20 +137,6 @@ init(nil: ref Draw->Context, args: list of string) fail("export", sys->sprint("can't export %s: %r", tree)); } -readn(fd: ref Sys->FD, buf: array of byte, nb: int): int -{ - for(nr := 0; nr < nb;){ - n := sys->read(fd, buf[nr:], nb-nr); - if(n <= 0){ - if(nr == 0) - return n; - break; - } - nr += n; - } - return nr; -} - S(a: array of byte): string { s := ""; -- cgit v1.2.3