Skip to content

Commit c0d7b57

Browse files
committed
io/ompio: fix seek position calculation for SEEK_CUR
This commit fixes the calculation of the position where to seek to, in case SEEK_CUR is used. Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu>
1 parent 6ed68da commit c0d7b57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@ int mca_io_ompio_file_seek (ompi_file_t *fh,
400400
}
401401
break;
402402
case MPI_SEEK_CUR:
403-
offset += data->ompio_fh.f_position_in_file_view;
404-
offset += data->ompio_fh.f_disp;
403+
ret = mca_common_ompio_file_get_position (&data->ompio_fh,
404+
&temp_offset);
405+
offset += temp_offset;
405406
if (offset < 0) {
406407
OPAL_THREAD_UNLOCK(&fh->f_lock);
407408
return OMPI_ERROR;

0 commit comments

Comments
 (0)