Skip to content

Commit 4db9c01

Browse files
committed
Renamed variable and fixed comments referring to renamed FileDescriptor
1 parent 59cb24d commit 4db9c01

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/tools/miri/src/shims/unix/fd.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub(crate) enum FlockOp {
2121
Unlock,
2222
}
2323

24-
/// Represents an open file descriptor.
24+
/// Represents an open file description.
2525
pub trait FileDescription: std::fmt::Debug + Any {
2626
fn name(&self) -> &'static str;
2727

@@ -303,7 +303,7 @@ pub struct FdTable {
303303

304304
impl VisitProvenance for FdTable {
305305
fn visit_provenance(&self, _visit: &mut VisitWith<'_>) {
306-
// All our FileDescriptor do not have any tags.
306+
// All our FileDescriptionRef do not have any tags.
307307
}
308308
}
309309

@@ -411,7 +411,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
411411

412412
fn flock(&mut self, fd: i32, op: i32) -> InterpResult<'tcx, Scalar> {
413413
let this = self.eval_context_mut();
414-
let Some(file_descriptor) = this.machine.fds.get(fd) else {
414+
let Some(fd_ref) = this.machine.fds.get(fd) else {
415415
return Ok(Scalar::from_i32(this.fd_not_found()?));
416416
};
417417

@@ -436,8 +436,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
436436
throw_unsup_format!("unsupported flags {:#x}", op);
437437
};
438438

439-
let result = file_descriptor.flock(this.machine.communicate(), parsed_op)?;
440-
drop(file_descriptor);
439+
let result = fd_ref.flock(this.machine.communicate(), parsed_op)?;
440+
drop(fd_ref);
441441
// return `0` if flock is successful
442442
let result = result.map(|()| 0i32);
443443
Ok(Scalar::from_i32(this.try_unwrap_io_result(result)?))
@@ -539,7 +539,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
539539
) -> InterpResult<'tcx, Scalar> {
540540
let this = self.eval_context_mut();
541541

542-
// Isolation check is done via `FileDescriptor` trait.
542+
// Isolation check is done via `FileDescription` trait.
543543

544544
trace!("Reading from FD {}, size {}", fd, count);
545545

@@ -604,7 +604,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
604604
) -> InterpResult<'tcx, Scalar> {
605605
let this = self.eval_context_mut();
606606

607-
// Isolation check is done via `FileDescriptor` trait.
607+
// Isolation check is done via `FileDescription` trait.
608608

609609
// Check that the *entire* buffer is actually valid memory.
610610
this.check_ptr_access(buf, Size::from_bytes(count), CheckInAllocMsg::MemoryAccessTest)?;

src/tools/miri/src/shims/unix/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
557557
fn lseek64(&mut self, fd: i32, offset: i128, whence: i32) -> InterpResult<'tcx, Scalar> {
558558
let this = self.eval_context_mut();
559559

560-
// Isolation check is done via `FileDescriptor` trait.
560+
// Isolation check is done via `FileDescription` trait.
561561

562562
let seek_from = if whence == this.eval_libc_i32("SEEK_SET") {
563563
if offset < 0 {

0 commit comments

Comments
 (0)