diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-11-08 00:31:44 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-11-08 00:31:44 +0000 |
commit | 1fd366130f2b0cc273cebe7f3570c81b0c45916c (patch) | |
tree | 43b0da6569d897043df8f13143ca356c4d8f29c0 | |
parent | 2001-11-07 Jennifer Averett <jennifer@OARcorp.com> (diff) | |
download | rtems-1fd366130f2b0cc273cebe7f3570c81b0c45916c.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.
-rw-r--r-- | c/src/lib/libc/imfs_directory.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/c/src/lib/libc/imfs_directory.c b/c/src/lib/libc/imfs_directory.c index 38280c565c..3bff614b30 100644 --- a/c/src/lib/libc/imfs_directory.c +++ b/c/src/lib/libc/imfs_directory.c @@ -175,19 +175,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 = (offset/sizeof(struct dirent)) * sizeof(struct dirent); break; case SEEK_END: /* Movement past the end of the directory via lseek */ |