diff options
author | Jake Burkholder <jake@FreeBSD.org> | 2002-04-24 01:47:05 +0000 |
---|---|---|
committer | Jake Burkholder <jake@FreeBSD.org> | 2002-04-24 01:47:05 +0000 |
commit | e2b255fdea84ab11f13560c81f13e854b4120228 (patch) | |
tree | 8cf96b370a2c4389eb6c8beb19e23fb1d176db5e /sys/boot/sparc64 | |
parent | 912ceb7f18e408b5bc4637e233328bec7c623ea2 (diff) | |
download | src-e2b255fdea84ab11f13560c81f13e854b4120228.tar.gz src-e2b255fdea84ab11f13560c81f13e854b4120228.zip |
Remove xfsread. Just call fsread directly.
Notes
Notes:
svn path=/head/; revision=95338
Diffstat (limited to 'sys/boot/sparc64')
-rw-r--r-- | sys/boot/sparc64/boot1/boot1.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/boot/sparc64/boot1/boot1.c b/sys/boot/sparc64/boot1/boot1.c index 74a563c0d59e..646d6ec710d6 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) { |