From 6f43d82ecb3b8bbe6188b51acf136a260727ee81 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 24 Apr 2001 23:10:04 +0000 Subject: 2001-04-24 Joel Sherrill * libc/libio.c (rtems_libio_allocate): Make sure size and offset fields are cleared on each file open. Before this field was cleared, this resulted in the value from the last time that IOP was used being still in place. Discovered by Andrew Bythell . * libc/open.c: Remove redundant setting of iop->offset. --- c/src/lib/libc/libio.c | 2 ++ c/src/lib/libc/open.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'c/src/lib/libc') diff --git a/c/src/lib/libc/libio.c b/c/src/lib/libc/libio.c index 9c0c09776c..1216ec15a5 100644 --- a/c/src/lib/libc/libio.c +++ b/c/src/lib/libc/libio.c @@ -208,6 +208,8 @@ rtems_libio_t *rtems_libio_allocate( void ) rtems_libio_iop_freelist = iop->data1; iop->data1 = 0; iop->flags = LIBIO_FLAGS_OPEN; + iop->size = 0; + iop->offset = 0; goto done; } diff --git a/c/src/lib/libc/open.c b/c/src/lib/libc/open.c index f777fe6379..d1dbcb77c4 100644 --- a/c/src/lib/libc/open.c +++ b/c/src/lib/libc/open.c @@ -146,7 +146,6 @@ int open( * returned by successful path evaluation. */ - iop->offset = 0; iop->handlers = loc.handlers; iop->file_info = loc.node_access; iop->flags |= rtems_libio_fcntl_flags( flags ); -- cgit v1.2.3