2001-04-24 Joel Sherrill <joel@OARcorp.com>

* 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
	<abythell@nortelnetworks.com>.
	* libc/open.c: Remove redundant setting of iop->offset.
This commit is contained in:
Joel Sherrill
2001-04-24 23:10:04 +00:00
parent eb22ebe0ec
commit 6f43d82ecb
7 changed files with 15 additions and 3 deletions

View File

@@ -208,6 +208,8 @@ rtems_libio_t *rtems_libio_allocate( void )
rtems_libio_iop_freelist = iop->data1; rtems_libio_iop_freelist = iop->data1;
iop->data1 = 0; iop->data1 = 0;
iop->flags = LIBIO_FLAGS_OPEN; iop->flags = LIBIO_FLAGS_OPEN;
iop->size = 0;
iop->offset = 0;
goto done; goto done;
} }

View File

@@ -146,7 +146,6 @@ int open(
* returned by successful path evaluation. * returned by successful path evaluation.
*/ */
iop->offset = 0;
iop->handlers = loc.handlers; iop->handlers = loc.handlers;
iop->file_info = loc.node_access; iop->file_info = loc.node_access;
iop->flags |= rtems_libio_fcntl_flags( flags ); iop->flags |= rtems_libio_fcntl_flags( flags );

View File

@@ -1,3 +1,12 @@
2001-04-24 Joel Sherrill <joel@OARcorp.com>
* 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
<abythell@nortelnetworks.com>.
* libc/open.c: Remove redundant setting of iop->offset.
2001-04-20 Correo Fernando-ruiz <correo@fernando-ruiz.com> 2001-04-20 Correo Fernando-ruiz <correo@fernando-ruiz.com>
* include/rtems/libio_.h, libc/chroot.c, libc/privateenv.c: * include/rtems/libio_.h, libc/chroot.c, libc/privateenv.c:

View File

@@ -208,6 +208,8 @@ rtems_libio_t *rtems_libio_allocate( void )
rtems_libio_iop_freelist = iop->data1; rtems_libio_iop_freelist = iop->data1;
iop->data1 = 0; iop->data1 = 0;
iop->flags = LIBIO_FLAGS_OPEN; iop->flags = LIBIO_FLAGS_OPEN;
iop->size = 0;
iop->offset = 0;
goto done; goto done;
} }

View File

@@ -146,7 +146,6 @@ int open(
* returned by successful path evaluation. * returned by successful path evaluation.
*/ */
iop->offset = 0;
iop->handlers = loc.handlers; iop->handlers = loc.handlers;
iop->file_info = loc.node_access; iop->file_info = loc.node_access;
iop->flags |= rtems_libio_fcntl_flags( flags ); iop->flags |= rtems_libio_fcntl_flags( flags );

View File

@@ -208,6 +208,8 @@ rtems_libio_t *rtems_libio_allocate( void )
rtems_libio_iop_freelist = iop->data1; rtems_libio_iop_freelist = iop->data1;
iop->data1 = 0; iop->data1 = 0;
iop->flags = LIBIO_FLAGS_OPEN; iop->flags = LIBIO_FLAGS_OPEN;
iop->size = 0;
iop->offset = 0;
goto done; goto done;
} }

View File

@@ -146,7 +146,6 @@ int open(
* returned by successful path evaluation. * returned by successful path evaluation.
*/ */
iop->offset = 0;
iop->handlers = loc.handlers; iop->handlers = loc.handlers;
iop->file_info = loc.node_access; iop->file_info = loc.node_access;
iop->flags |= rtems_libio_fcntl_flags( flags ); iop->flags |= rtems_libio_fcntl_flags( flags );