From acc54ef8a8fd81e473597b8daa2a19704f52599f Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 18 Jan 2009 21:47:57 +0000 Subject: 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. --- sys/arch/mvme88k/stand/tftpboot/tftpfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3