summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-11-08 00:24:55 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-11-08 00:24:55 +0000
commit47901d84b3fb3119c2baf96a71fbe7158a7d5d7c (patch)
tree353a1751aeea8dfbf8776fdcf93375975b68df6c /cpukit
parentf2278a8585fc77cbe53ec8b977a43a9273ff4279 (diff)
downloadrtems-47901d84b3fb3119c2baf96a71fbe7158a7d5d7c.tar.bz2
2001-11-07 Jennifer Averett <jennifer@OARcorp.com>
Reported by Ibragimov Ilya <ibr@oktet.ru> and tracked as PR49. * src/imfs/imfs_directory.c: Do not calculate the offset twice.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libfs/ChangeLog5
-rw-r--r--cpukit/libfs/src/imfs/imfs_directory.c12
2 files changed, 7 insertions, 10 deletions
diff --git a/cpukit/libfs/ChangeLog b/cpukit/libfs/ChangeLog
index 2d8563c468..a9e883da45 100644
--- a/cpukit/libfs/ChangeLog
+++ b/cpukit/libfs/ChangeLog
@@ -1,3 +1,8 @@
+2001-11-07 Jennifer Averett <jennifer@OARcorp.com>
+
+ Reported by Ibragimov Ilya <ibr@oktet.ru> and tracked as PR49.
+ * src/imfs/imfs_directory.c: Do not calculate the offset twice.
+
2001-10-26 Victor V. Vengerov <vvv@oktet.ru>
* src/imfs/imfs_load_tar.c: Minor modification so this will
diff --git a/cpukit/libfs/src/imfs/imfs_directory.c b/cpukit/libfs/src/imfs/imfs_directory.c
index fc9d44828d..9df4543909 100644
--- a/cpukit/libfs/src/imfs/imfs_directory.c
+++ b/cpukit/libfs/src/imfs/imfs_directory.c
@@ -187,18 +187,11 @@ int imfs_dir_lseek(
int whence
)
{
- off_t normal_offset;
-
- normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);
-
-
switch( whence ) {
case SEEK_SET: /* absolute move from the start of the file */
- iop->offset = normal_offset;
- break;
-
case SEEK_CUR: /* relative move */
- iop->offset = iop->offset + normal_offset;
+ iop->offset = (iop->offset/sizeof(struct dirent)) *
+ sizeof(struct dirent);
break;
case SEEK_END: /* Movement past the end of the directory via lseek */
@@ -206,7 +199,6 @@ int imfs_dir_lseek(
default:
set_errno_and_return_minus_one( EINVAL );
break;
-
}
return 0;