summaryrefslogtreecommitdiff
path: root/appl/lib/disks.b
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2007-07-14 10:41:18 +0000
committerCharles.Forsyth <devnull@localhost>2007-07-14 10:41:18 +0000
commita6011949be081a8fe1bec0713ce60c36beb3a351 (patch)
tree0855fa75f38a7361a9b7a9fe12608bd99761add0 /appl/lib/disks.b
parentd42218ac2785e9e4bea53ec499f563cab5747959 (diff)
20070714-1142
Diffstat (limited to 'appl/lib/disks.b')
-rw-r--r--appl/lib/disks.b20
1 files changed, 3 insertions, 17 deletions
diff --git a/appl/lib/disks.b b/appl/lib/disks.b
index ac718af1..2918b2cc 100644
--- a/appl/lib/disks.b
+++ b/appl/lib/disks.b
@@ -72,14 +72,14 @@ partitiongeometry(d: ref Disk): int
rawfd := sys->open(d.prefix+"data", Sys->OREAD);
if(rawfd != nil
&& sys->seek(rawfd, big 0, 0) == big 0
- && readn(rawfd, buf, 512) == 512
+ && sys->readn(rawfd, buf, 512) == 512
&& int t[Omagic] == Magic0
&& int t[Omagic+1] == Magic1) {
rawfd = nil;
}else{
rawfd = nil;
if(sys->seek(d.fd, big 0, 0) < big 0
- || readn(d.fd, buf, 512) != 512
+ || sys->readn(d.fd, buf, 512) != 512
|| int t[Omagic] != Magic0
|| int t[Omagic+1] != Magic1)
return -1;
@@ -350,7 +350,7 @@ putle32(p: array of byte, i: big)
Disk.readn(d: self ref Disk, buf: array of byte, nb: int): int
{
- return readn(d.fd, buf, nb);
+ return sys->readn(d.fd, buf, nb);
}
chstext(p: array of byte): string
@@ -361,17 +361,3 @@ chstext(p: array of byte): string
s := (int p[1] & 16r3F);
return sys->sprint("%d/%d/%d", c, h, s);
}
-
-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;
-}