summaryrefslogtreecommitdiff
path: root/appl/cmd/9export.b
diff options
context:
space:
mode:
Diffstat (limited to 'appl/cmd/9export.b')
-rw-r--r--appl/cmd/9export.b16
1 files changed, 1 insertions, 15 deletions
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 := "";