summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-04-24 23:10:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-04-24 23:10:04 +0000
commit6f43d82ecb3b8bbe6188b51acf136a260727ee81 (patch)
tree0186a9e88e8e2d1edcbeb02d40e8ed815d84f713 /c
parent2001-04-24 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-6f43d82ecb3b8bbe6188b51acf136a260727ee81.tar.bz2
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.
Diffstat (limited to 'c')
-rw-r--r--c/src/exec/libcsupport/src/libio.c2
-rw-r--r--c/src/exec/libcsupport/src/open.c1
-rw-r--r--c/src/lib/ChangeLog9
-rw-r--r--c/src/lib/libc/libio.c2
-rw-r--r--c/src/lib/libc/open.c1
5 files changed, 13 insertions, 2 deletions
diff --git a/c/src/exec/libcsupport/src/libio.c b/c/src/exec/libcsupport/src/libio.c
index 9c0c09776c..1216ec15a5 100644
--- a/c/src/exec/libcsupport/src/libio.c
+++ b/c/src/exec/libcsupport/src/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/exec/libcsupport/src/open.c b/c/src/exec/libcsupport/src/open.c
index f777fe6379..d1dbcb77c4 100644
--- a/c/src/exec/libcsupport/src/open.c
+++ b/c/src/exec/libcsupport/src/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 );
diff --git a/c/src/lib/ChangeLog b/c/src/lib/ChangeLog
index 49c66aaafe..5148d26e06 100644
--- a/c/src/lib/ChangeLog
+++ b/c/src/lib/ChangeLog
@@ -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>
* include/rtems/libio_.h, libc/chroot.c, libc/privateenv.c:
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 );