diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2005-01-30 12:11:15 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2005-01-30 12:11:15 +0000 |
| commit | b0ccaf92abee04c948865b5f15babcb4029e500a (patch) | |
| tree | 0d713fced201c1e01c382b82a5b246470a23fc54 /sys/boot | |
| parent | 8427097e3bd37b217be3d25c970f39bef1a8d905 (diff) | |
Notes
Diffstat (limited to 'sys/boot')
| -rw-r--r-- | sys/boot/common/load.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/boot/common/load.c b/sys/boot/common/load.c index 7470f966bb2a..a4c665d72ff4 100644 --- a/sys/boot/common/load.c +++ b/sys/boot/common/load.c @@ -45,10 +45,10 @@ filedup(const char *path, int flags) char *buf; int fd; size_t size, result; - + if ((fd = open(path, F_READ | flags)) == -1) return(NULL); - + printf("%s open, flags 0x%x\n", path, files[fd].f_flags); buf = alloc(LOAD_TINYBUF); @@ -68,8 +68,7 @@ filedup(const char *path, int flags) printf("tinybuf loaded, size %d\n", size); getchar(); - - + /* Read everything until we know how big it is */ for (;;) { result = read(fd, buf, LOAD_TINYBUF); @@ -82,7 +81,7 @@ filedup(const char *path, int flags) break; size += result; } - + /* discard the old buffer, close the file */ free(buf, LOAD_TINYBUF); close(fd); |
