summaryrefslogtreecommitdiffstats
path: root/sys/boot/sparc64/boot1
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-04-24 01:47:05 +0000
committerjake <jake@FreeBSD.org>2002-04-24 01:47:05 +0000
commit205c7831cd29c7aabc688117ac0fcee60d8605ac (patch)
tree8cf96b370a2c4389eb6c8beb19e23fb1d176db5e /sys/boot/sparc64/boot1
parent1aa7da0fd6192063f5be01b9c866eeab3aed4701 (diff)
downloadFreeBSD-src-205c7831cd29c7aabc688117ac0fcee60d8605ac.zip
FreeBSD-src-205c7831cd29c7aabc688117ac0fcee60d8605ac.tar.gz
Remove xfsread. Just call fsread directly.
Diffstat (limited to 'sys/boot/sparc64/boot1')
-rw-r--r--sys/boot/sparc64/boot1/boot1.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/boot/sparc64/boot1/boot1.c b/sys/boot/sparc64/boot1/boot1.c
index 74a563c..646d6ec 100644
--- a/sys/boot/sparc64/boot1/boot1.c
+++ b/sys/boot/sparc64/boot1/boot1.c
@@ -55,7 +55,6 @@ int main(void);
void exit(int);
static void load(const char *);
static ino_t lookup(const char *);
-static int xfsread(ino_t, void *, size_t);
static ssize_t fsread(ino_t, void *, size_t);
static int dskread(void *, u_int64_t, int);
static int printf(const char *, ...);
@@ -325,7 +324,7 @@ load(const char *fname)
printf("File %s not found\n", fname);
return;
}
- if (xfsread(ino, &eh, sizeof(eh)))
+ if (fsread(ino, &eh, sizeof(eh)) != sizeof(eh))
return;
if (!IS_ELF(eh)) {
printf("Not an ELF file\n");
@@ -333,7 +332,7 @@ load(const char *fname)
}
fs_off = eh.e_phoff;
for (j = i = 0; i < eh.e_phnum && j < 2; i++) {
- if (xfsread(ino, ep + j, sizeof(ep[0])))
+ if (fsread(ino, ep + j, sizeof(ep[0])) != sizeof(ep[0]))
return;
if (ep[j].p_type == PT_LOAD)
j++;
@@ -341,7 +340,7 @@ load(const char *fname)
for (i = 0; i < j; i++) {
p = (caddr_t)ep[i].p_vaddr;
fs_off = ep[i].p_offset;
- if (xfsread(ino, p, ep[i].p_filesz))
+ if (fsread(ino, p, ep[i].p_filesz) != ep[i].p_filesz)
return;
/*
* Assume the second program header table entry
@@ -355,13 +354,13 @@ load(const char *fname)
p += roundup2(ep[1].p_memsz, PAGE_SIZE);
if (eh.e_shnum == eh.e_shstrndx + 3) {
fs_off = eh.e_shoff + sizeof(es[0]) * (eh.e_shstrndx + 1);
- if (xfsread(ino, &es, sizeof(es)))
+ if (fsread(ino, &es, sizeof(es)) != sizeof(es))
return;
for (i = 0; i < 2; i++) {
memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size));
p += sizeof(es[i].sh_size);
fs_off = es[i].sh_offset;
- if (xfsread(ino, p, es[i].sh_size))
+ if (fsread(ino, p, es[i].sh_size) != es[i].sh_size)
return;
p += es[i].sh_size;
}
@@ -406,16 +405,6 @@ lookup(const char *path)
return (dt == DT_REG ? ino : 0);
}
-static int
-xfsread(ino_t inode, void *buf, size_t nbyte)
-{
- if (fsread(inode, buf, nbyte) != (ssize_t)nbyte) {
- printf("Invalid %s\n", "format");
- return (-1);
- }
- return (0);
-}
-
static ssize_t
fsread(ino_t inode, void *buf, size_t nbyte)
{
OpenPOWER on IntegriCloud