summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-01-18 21:47:57 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-01-18 21:47:57 +0000
commitacc54ef8a8fd81e473597b8daa2a19704f52599f (patch)
treeb2e13c5aa73caa0b76dd57a9cbdf32a5a64c68ab
parentff44168705fb040fffdf010b3719aa3a86316cda (diff)
Recompute file pointer position when seeking backwards, as it gets reinitialized
to zero otherwise; allows the tftp bootloader to work again after the switch to the MI loadfile code.
-rw-r--r--sys/arch/mvme88k/stand/tftpboot/tftpfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/mvme88k/stand/tftpboot/tftpfs.c b/sys/arch/mvme88k/stand/tftpboot/tftpfs.c
index acfafe4dff6..3a59fdcc035 100644
--- a/sys/arch/mvme88k/stand/tftpboot/tftpfs.c
+++ b/sys/arch/mvme88k/stand/tftpboot/tftpfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftpfs.c,v 1.3 2006/08/13 23:08:43 miod Exp $ */
+/* $OpenBSD: tftpfs.c,v 1.4 2009/01/18 21:47:56 miod Exp $ */
/*-
* Copyright (c) 2001 Steve Murphree, Jr.
@@ -118,6 +118,8 @@ tftp_read_file(f, buf_p, size_p)
strlcpy(filename, fp->filename, sizeof filename);
tftpfs_close(f);
tftpfs_open(filename, f);
+ /* restore f_seekp reset by tftpfs_open() */
+ fp->f_seekp = (file_block - 1) * TFTP_BLOCK_SIZE + off;
for (i = 1; i <= file_block; i++) {
rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
i, block_size, fp->f_buf, &fp->f_buf_size);