diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-11-08 00:24:55 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-11-08 00:24:55 +0000 |
commit | 47901d84b3fb3119c2baf96a71fbe7158a7d5d7c (patch) | |
tree | 353a1751aeea8dfbf8776fdcf93375975b68df6c /cpukit | |
parent | 2001-11-07 Jennifer Averett <jennifer@OARcorp.com> (diff) | |
download | rtems-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/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_directory.c | 12 |
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; |