forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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>
|
2001-10-26 Victor V. Vengerov <vvv@oktet.ru>
|
||||||
|
|
||||||
* src/imfs/imfs_load_tar.c: Minor modification so this will
|
* src/imfs/imfs_load_tar.c: Minor modification so this will
|
||||||
|
|||||||
@@ -187,18 +187,11 @@ int imfs_dir_lseek(
|
|||||||
int whence
|
int whence
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
off_t normal_offset;
|
|
||||||
|
|
||||||
normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);
|
|
||||||
|
|
||||||
|
|
||||||
switch( whence ) {
|
switch( whence ) {
|
||||||
case SEEK_SET: /* absolute move from the start of the file */
|
case SEEK_SET: /* absolute move from the start of the file */
|
||||||
iop->offset = normal_offset;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SEEK_CUR: /* relative move */
|
case SEEK_CUR: /* relative move */
|
||||||
iop->offset = iop->offset + normal_offset;
|
iop->offset = (iop->offset/sizeof(struct dirent)) *
|
||||||
|
sizeof(struct dirent);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SEEK_END: /* Movement past the end of the directory via lseek */
|
case SEEK_END: /* Movement past the end of the directory via lseek */
|
||||||
@@ -206,7 +199,6 @@ int imfs_dir_lseek(
|
|||||||
default:
|
default:
|
||||||
set_errno_and_return_minus_one( EINVAL );
|
set_errno_and_return_minus_one( EINVAL );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -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>
|
2001-10-26 Victor V. Vengerov <vvv@oktet.ru>
|
||||||
|
|
||||||
* src/imfs/imfs_load_tar.c: Minor modification so this will
|
* src/imfs/imfs_load_tar.c: Minor modification so this will
|
||||||
|
|||||||
@@ -187,18 +187,11 @@ int imfs_dir_lseek(
|
|||||||
int whence
|
int whence
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
off_t normal_offset;
|
|
||||||
|
|
||||||
normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);
|
|
||||||
|
|
||||||
|
|
||||||
switch( whence ) {
|
switch( whence ) {
|
||||||
case SEEK_SET: /* absolute move from the start of the file */
|
case SEEK_SET: /* absolute move from the start of the file */
|
||||||
iop->offset = normal_offset;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SEEK_CUR: /* relative move */
|
case SEEK_CUR: /* relative move */
|
||||||
iop->offset = iop->offset + normal_offset;
|
iop->offset = (iop->offset/sizeof(struct dirent)) *
|
||||||
|
sizeof(struct dirent);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SEEK_END: /* Movement past the end of the directory via lseek */
|
case SEEK_END: /* Movement past the end of the directory via lseek */
|
||||||
@@ -206,7 +199,6 @@ int imfs_dir_lseek(
|
|||||||
default:
|
default:
|
||||||
set_errno_and_return_minus_one( EINVAL );
|
set_errno_and_return_minus_one( EINVAL );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -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>
|
2001-10-26 Victor V. Vengerov <vvv@oktet.ru>
|
||||||
|
|
||||||
* src/imfs/imfs_load_tar.c: Minor modification so this will
|
* src/imfs/imfs_load_tar.c: Minor modification so this will
|
||||||
|
|||||||
@@ -187,18 +187,11 @@ int imfs_dir_lseek(
|
|||||||
int whence
|
int whence
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
off_t normal_offset;
|
|
||||||
|
|
||||||
normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);
|
|
||||||
|
|
||||||
|
|
||||||
switch( whence ) {
|
switch( whence ) {
|
||||||
case SEEK_SET: /* absolute move from the start of the file */
|
case SEEK_SET: /* absolute move from the start of the file */
|
||||||
iop->offset = normal_offset;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SEEK_CUR: /* relative move */
|
case SEEK_CUR: /* relative move */
|
||||||
iop->offset = iop->offset + normal_offset;
|
iop->offset = (iop->offset/sizeof(struct dirent)) *
|
||||||
|
sizeof(struct dirent);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SEEK_END: /* Movement past the end of the directory via lseek */
|
case SEEK_END: /* Movement past the end of the directory via lseek */
|
||||||
@@ -206,7 +199,6 @@ int imfs_dir_lseek(
|
|||||||
default:
|
default:
|
||||||
set_errno_and_return_minus_one( EINVAL );
|
set_errno_and_return_minus_one( EINVAL );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user